From 1ed1f959b64dbcef0fadee59e7fed79bf642fe0f Mon Sep 17 00:00:00 2001 From: don Date: Fri, 13 Oct 2006 23:06:12 +0000 Subject: [PATCH] add moving pidfile and initscript support --- debian/spamass-milter.default | 7 ++++--- debian/spamass-milter.init | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/debian/spamass-milter.default b/debian/spamass-milter.default index c4cd67c..85cfd62 100644 --- a/debian/spamass-milter.default +++ b/debian/spamass-milter.default @@ -13,6 +13,7 @@ OPTIONS="-u nobody -i 127.0.0.1" # Do not modify Subject:, Content-Type: or body. #OPTIONS="-m" -# If you are using postfix, you may want to use the following -# SOCKET="/var/spool/postfix/spamass.sock" -# RUNAS="postfix" \ No newline at end of file +# If you are using postfix, you probably want to uncomment the following +# SOCKET="/var/spool/postfix/spamass/spamass.sock" +# RUNAS="postfix" +# PIDFILE="/var/spool/postfix/spamass/spamass.pid" \ No newline at end of file diff --git a/debian/spamass-milter.init b/debian/spamass-milter.init index a262c2d..deb05e6 100644 --- a/debian/spamass-milter.init +++ b/debian/spamass-milter.init @@ -60,6 +60,15 @@ case "$1" in if [ ! -d $(dirname $SOCKET) ]; then mkdir -p $(dirname $SOCKET); + if [ -n "$RUNAS" ]; then + chown "$RUNAS" $(dirname $SOCKET); + fi; + fi; + if [ ! -d $(dirname $PIDFILE) ]; then + mkdir -p $(dirname $PIDFILE); + if [ -n "$RUNAS" ]; then + chown "$RUNAS" $(dirname $PIDFILE); + fi; fi; start-stop-daemon --start -p $PIDFILE $CHUID --exec $DAEMON -- -P $PIDFILE -f -p $SOCKET $OPTIONS -- 2.39.2