Hi,

problem:
* if option -m is given in var $PARAMS the saslauthd uses another
workingdirectory, but in init script the cwd and the dir of pidfile are
allways the same.
* problems could be:
        - wd does not exists
        - pidfile not found by initscript during start/stop action

my solution:
* init script now checks if option -m is given and adjusts the
working/pidfile directories for the saslauthd, depending on directory
after -m.

best regards,
Michael
--- cyrus-sasl2-2.1.19.dfsg1/debian/sasl2-bin.init      2006-09-16 
17:36:15.000000000 +0000
+++ cyrus-sasl2-2.1.19.dfsg1.new/debian/sasl2-bin.init  2006-09-16 
16:53:12.000000000 +0000
@@ -3,9 +3,8 @@
 NAME=saslauthd
 DAEMON="/usr/sbin/${NAME}"
 DESC="SASL Authentication Daemon"
-DEFAULTS=/etc/default/saslauthd
-PWDIR=/var/run/saslauthd
-PIDFILE="/var/run/${NAME}/saslauthd.pid"
+DEFAULTS=/etc/default/${NAME}
+DEFAULTPWD=/var/run/${NAME}
 
 createdir() {
 # $1 = user
@@ -23,6 +22,13 @@
 if [ -e "${DEFAULTS}" ]; then
     . "${DEFAULTS}"
 fi
+# adjust working directory
+PWDIR=$(echo ${PARAMS} | xargs -n 1 echo | sed -n '/^-m$/{n;p}')
+       if [ -z ${PWDIR} ];then
+               PWDIR=${DEFAULTPWD}
+       fi
+
+PIDFILE="${PWDIR}/${NAME}.pid"
 
 # If we're not to start the daemon, simply exit
 if [ "${START}" != "yes" ]; then
@@ -44,7 +50,7 @@
 case "${1}" in
   start)
         echo -n "Starting ${DESC}: "
-       dir=`dpkg-statoverride --list $PWDIR`
+       dir=`dpkg-statoverride --list ${DEFAULTPWD} | sed 
"s#${DEFAULTPWD}#${PWDIR}#"`
        test -z "$dir" || createdir $dir
        if start-stop-daemon ${START} >/dev/null 2>&1 ; then
                echo "${NAME}."
@@ -57,7 +63,7 @@
                        exit 0
                fi
        fi
-        ;;
+       ;;
   stop)
         echo -n "Stopping ${DESC}: "
         if start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" \
--- cyrus-sasl2-2.1.19.dfsg1/debian/changelog   2006-09-16 17:36:15.000000000 
+0000
+++ cyrus-sasl2-2.1.19.dfsg1.new/debian/changelog       2006-09-16 
15:36:21.000000000 +0000
@@ -1,3 +1,12 @@
+cyrus-sasl2 (2.1.19.dfsg1-0.4) unstable; urgency=low
+
+  * Non-maintainer upload during BSP
+  * changed init script for option -m in saslauthd
+    (Thanks Elmar Hoffmann for your help) 
+    Closes: #364395.
+
+ -- Michael Steinfurth <[EMAIL PROTECTED]>  Sat, 16 Sep 2006 15:25:52 +0000
+
 cyrus-sasl2 (2.1.19.dfsg1-0.3) unstable; urgency=high
 
   * Non-maintainer upload

Reply via email to