Debian Postfix backports and SASL2

Alexander Skwar lists.ASkwar at email-server.info
Tue Apr 29 07:37:00 EDT 2003


David Hearn wrote:

> At the moment, I've turned it off due to problems with it accessing the
> mysql socket - but I think I know a way around that, and shall probably try

That's not hard.  Shutdown MySQL and move the whole directory
/var/run/mysqld to /var/spool/var/run (which you have to create first).
 Same with /var/run/saslauthd.   Then replace these directories with
links; ie:

ln -s ../spool/postfix/var/run/{saslauthd,mysqld} /var/run

Now, since /var/run is completely removed during boot, you've also got
to modify some startup script to re-create the links.  I've modified
/etc/init.d/mysql like this:

--- etc/init.d/mysql    2002-12-30 14:55:51.000000000 +0100
+++ /etc/init.d/mysql   2003-04-29 13:31:59.000000000 +0200
@@ -39,6 +39,8 @@
         fi
        # Start daemon
        echo -n "Starting MySQL database server: mysqld"
+       [ -e /var/run/mysqld ] ||ln -s ../spool/postfix/var/run/mysqld \
+                                       /var/run/mysqld
        /usr/bin/safe_mysqld > /dev/null 2>&1 &
        for i in 1 2 3 4 5 6; do
          if is_mysqld_alive; then break; fi

Next I modified the "socket" statements in /etc/mysql/my.cnf to point to
the new socket and pid location:
/var/spool/postfix/var/run/mysqld/mysqld.sock and
/var/spool/postfix/var/run/mysqld/mysqld.pid

I also had to modify the saslauthd init script:

--- ./etc/init.d/saslauthd      2002-12-30 18:59:33.000000000 +0100
+++ /etc/init.d/saslauthd       2003-04-24 14:21:11.000000000 +0200
@@ -11,9 +11,10 @@
 # $2 = group
 # $3 = permissions (octal)
 # $4 = path to directory
-        [ -d "$4" ] || mkdir -p "$4"
-        chown -c -h "$1:$2" "$4"
-        chmod -c "$3" "$4"
+       dir=/var/spool/postfix$4
+        [ -d "$dir" ] || mkdir -p "$dir"
+        chown -c -h "$1:$2" "$dir"
+        chmod -c "$3" "$dir"
 }

 test -f "${DAEMON}" || exit 0
@@ -45,6 +46,7 @@
         echo -n "Starting ${DESC}: "
        dir=`dpkg-statoverride --list $PWDIR`
        test -z "$dir" || createdir $dir
+       [ -e "$PWDIR" ] || ln -s /var/spool/postfix$PWDIR $PWDIR
         start-stop-daemon --start --quiet --pidfile
"/var/run/${NAME}/mux.pid" --exec "${DAEMON}" -- ${PARAMS}
         echo "${NAME}."
         ;;

After doing all of this, I'm able to run the postfix processes chrooted.

Alexander Skwar
-- 
Alexander Skwar
-- 
Signatur vorübergehend deaktiviert.






More information about the Info-cyrus mailing list