Define user and workdir for boardvoting service
authorJan Dittberner <jandd@cacert.org>
Wed, 28 Mar 2018 14:10:16 +0000 (16:10 +0200)
committerJan Dittberner <jandd@cacert.org>
Wed, 28 Mar 2018 14:10:16 +0000 (16:10 +0200)
sitemodules/profiles/files/cacert_boardvoting/init.sh

index dc815c6..763dec4 100644 (file)
@@ -16,6 +16,8 @@ BASE=boardvoting
 BOARDVOTING=/usr/local/bin/cacert-boardvoting
 BOARDVOTING_PIDFILE=/var/run/$BASE.pid
 BOARDVOTING_LOGFILE=/var/log/$BASE.log
+BOARDVOTING_WORKDIR=/var/lib/$BASE
+BOARDVOTING_USER=$BASE
 BOARDVOTING_OPTS=
 BOARDVOTING_DESC="Boardvoting"
 
@@ -49,7 +51,9 @@ case "$1" in
     log_begin_msg "Starting $BOARDVOTING_DESC: $BOARDVOTING"
     start-stop-daemon --start --background --no-close \
       --exec "$BOARDVOTING" \
+      --user "$BOARDVOTING_USER" \
       --pidfile "$BOARDVOTING_PIDFILE" \
+      --chdir "$BOARDVOTING_WORKDIR" \
       --make-pidfile \
       -- \
         $BOARDVOTING_OPTS >> "$BOARDVOTING_LOGFILE" 2>&1