From: Pierre Habouzit Date: Thu, 30 Aug 2007 22:04:18 +0000 (+0200) Subject: Use pidfile in initscript. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=1ff926eac33152aee930a454ac1d3dec6e6e5faf;p=apps%2Fpfixtools.git Use pidfile in initscript. Signed-off-by: Pierre Habouzit --- diff --git a/debian/pfixtools.init b/debian/pfixtools.init index eb92b4d..27347ca 100644 --- a/debian/pfixtools.init +++ b/debian/pfixtools.init @@ -13,6 +13,8 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin . /lib/lsb/init-functions test -r /etc/default/pfixtools && . /etc/default/pfixtools +mkdir -p /var/run/pfixtools &>/dev/null + isyes() { case "$1" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) true;; @@ -27,7 +29,10 @@ pidfile() { d_start() { log_daemon_msg "Starting pidxtools" if isyes "$SRSD_ENABLE" && test -x /usr/sbin/pfix-srsd; then - /usr/sbin/pfix-srsd $SRSD_OPTIONS "$pf" "$SRSD_DOMAIN" "$SRSD_SECRETS" + start_daemon -p /var/run/pfixtools/srsd.pid \ + /usr/sbin/pfix-srsd $SRSD_OPTIONS \ + -p /var/run/pfixtools/srsd.pid \ + "$SRSD_DOMAIN" "$SRSD_SECRETS" log_progress_msg "pidx-srsd" fi log_end_msg 0 @@ -36,7 +41,7 @@ d_start() { d_stop() { log_daemon_msg "Stopping pidxtools" if isyes "$SRSD_ENABLE"; then - killproc pfix-srsd + killproc -p /var/run/pfixtools/srsd.pid pfix-srsd log_progress_msg "pidx-srsd" fi log_end_msg 0