saslauthd init script does not allow movement of PID

Bug #79371 reported by El Diablo on 2007-01-15
10
Affects Status Importance Assigned to Milestone
Ubuntu Server papercuts
Medium
Unassigned
cyrus-sasl2 (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: sasl2-bin

Package: sasl2-bin
OS: Ubuntu Server 6.06 LTS
All Updates Applied: Yes

Problem:

Due to having to move the Cyrus-SASL mux socket to another directory, to allow postfix access to it, I later found that the init script at /etc/init.d/saslauthd could start, but, could not stop the daemon. I found that there is a small error in the start routine, and the lines read:

       dir=`dpkg-statoverride --list $PWDIR`
       test -z "$dir" || createdir $dir

dir always gets returned an empty string, and also the OWNER:GROUP:PERMS:DIR are not passed to the createdir script.

I removed those two lines and replaced them with the following:

       test -d $PWDIR || createdir root sasl 710 $PWDIR

Now when you change the location of the pid and socket, by setting in /etc/defaults/saslauthd

MECHANISMS="ldap"
PARAMS="-O /etc/saslauthd.conf -m /var/spool/postfix/var/run/saslauthd"
PWDIR="/var/spool/postfix/var/run/saslauthd"
PIDFILE="/var/spool/postfix/var/run/saslauthd/saslauthd.pid"

The directory, if non-existant is correctly created, and the the pid is known to the stop function.

Changed in cyrus-sasl2:
assignee: nobody → pitti
importance: Undecided → Low
El Diablo (el-diablo) wrote :

NOTE: I found yesterday also that as Cyrus-IMAP requires the socket to be located in /var/run/saslauthd/ , and would seem that you can not tell Cyrus-IMAP where to look for the socket (I am yet to 100% confirm this), that I had to make a symlink to the location where my socket was. Also as on reboots the symlink gets destroyed, I added the following two lines to my /etc/init.d/saslauthd script:

At the top in the variables section I added:

SYMLINK="/var/run/saslauthd"

after the test to create the socket directory (as stated above), I added the following line:

        test -h $SYMLINK || ln -s $PWDIR $SYMLINK

Hope this information is of use to you guys.

Martin Pitt (pitti) on 2007-03-21
Changed in cyrus-sasl2:
status: Unconfirmed → In Progress
Jörn Dreyer (j.dreyer) wrote :

At the end of /etc/defaults/saslauthd I added

SYMLINK="/var/run/saslauthd"

and in the initscript I added this before the createdir function:

#bug https://bugs.launchpad.net/ubuntu/+source/cyrus-sasl2/+bug/79371 quickfix
test -h $SYMLINK || ln -s $RUN_DIR $SYMLINK

the initscript will automagically create the $RUN_DIR by parsing the -m option if specified in $OPTIONS

Martin Pitt (pitti) on 2008-02-26
Changed in cyrus-sasl2:
assignee: pitti → ubuntu-server
status: In Progress → Confirmed
Christopher DeMarco (demarco) wrote :

There is an undocumented option to imapd.conf ``sasl_saslauthd_path'' which instructs the daemon to look in a non-standard location for the socket. I've opened a bug upstream with the Cyrus maintainers. Perhaps Ubuntu should update the imapd and imap.conf manpages to reflect this useful option?

Thierry Carrez (ttx) on 2010-02-18
Changed in server-papercuts:
importance: Undecided → Medium
status: New → Confirmed
Thierry Carrez (ttx) on 2010-03-02
Changed in server-papercuts:
milestone: none → lucid-beta-1
Thierry Carrez (ttx) on 2010-03-17
Changed in cyrus-sasl2 (Ubuntu):
assignee: Ubuntu Server Team (ubuntu-server) → nobody
Changed in server-papercuts:
milestone: lucid-beta-1 → lucid-beta-2
Thierry Carrez (ttx) wrote :

I think this is already fixed...
With the current version (in Lucid), you can't set PWDIR in the defaults file, its derived from the "-m" option. Then the following bit of code ensures the directory is created with the right rights:

if dpkg-statoverride --list $RUN_DIR > /dev/null; then
    createdir `dpkg-statoverride --list $RUN_DIR`
else
    createdir root sasl 710 $RUN_DIR
fi

Please reopen if you can reproduce with current lucid.

Changed in cyrus-sasl2 (Ubuntu):
status: Confirmed → Fix Released
Changed in server-papercuts:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers