From c86091da358b314e6679c7ed8d53a4ba5cf3493a Mon Sep 17 00:00:00 2001 From: Clemens Buchacher Date: Wed, 7 Mar 2012 20:27:30 +0100 Subject: [PATCH] specify an existing home directory or cron will complain The installation script adds a new user "darkstat", but it does not specify a home directory. This triggers a sanity check in cron.daily. It gives the following error: user 'darkstat': directory '/home/darkstat' does not exist pwck: no changes Fix this by pointing the darkstat user's home directory to the existing chroot for darkstat. Signed-off-by: Clemens Buchacher --- darkstat.install | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/darkstat.install b/darkstat.install index 542367d..8331016 100644 --- a/darkstat.install +++ b/darkstat.install @@ -2,11 +2,17 @@ daemon_name=darkstat daemon_chroot=/var/"$daemon_name" post_install() { - /usr/sbin/useradd -s /bin/false -r -N -g nobody "$daemon_name" - if [ ! -d "$daemon_chroot" ]; then install -d "$daemon_chroot" fi + + /usr/sbin/useradd \ + --system \ + --home "$daemon_chroot" \ + --shell /bin/false \ + --no-user-group \ + --gid nobody "$daemon_name" + chown -R "$daemon_name":nobody "$daemon_chroot" } -- 1.7.9.5