This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PMX, Debian, insserv

Hallo

We have had to solve a problem with this new (in Debian) dependency based boot sequence in the recent stable distribution (squeeze). In the good old times we just had to symlink from /etc/init.d/pipapo to the PMX and evetuelly the Postfix startup scripts. This will not work with any more.

You have to provide a start script containing a 'comment header'. It's better to write a wrapper script containig that 'comment header' than copying the PMX/Postfix start scripts in place. Any changes by updates of PMX would not be mentioned by the copy. You would have to copy them in such case.

You have two options to provide the 'comment header' for the wrapper scripts. First you could place them in a file of the same name as the wrapper in /etc/init.d in the distribution specific 'override' directory (e.g. /usr/share/insserv/overrides/ in Debian). This is what insserv manual recommends for third party scripts.

In our case this means one more file to keep in mind. So for simplicity just put the headers right into the wrapper script.

/etc/init.d/pmx-postfix:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          pmx-postfix
# Required-Start:    $local_fs $remote_fs $syslog $named $network $time $puremessage
# Required-Stop:     $local_fs $remote_fs $syslog $named $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: start and stop the Postfix Mail Transport Agent
# Description:       postfix is a Mail Transport agent
### END INIT INFO

# Author: me
#
# Wrapper-Script fuer PMX Postfix
#

PF_INIT=/opt/pmx6/postfix/etc/init.d/postfix
NAME=pmx-postfix
SCRIPTNAME=/etc/init.d/$NAME


case "$1" in
  start)
        $PF_INIT start
        ;;
  stop)
        $PF_INIT stop
        ;;
  status)
        $PF_INIT status
        ;;
  restart)
        $PF_INIT reload
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
        exit 3
        ;;
esac

exit 0

 /etc/init.d/puremessage:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          puremessage
# Required-Start:    $local_fs $remote_fs $syslog $named $network $time
# Required-Stop:     $local_fs $remote_fs $syslog $named $network $pmx-postfix
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: start and stop the Sophos PureMessage for Unix/Linux
# Description:       Sophos PureMessage for Unix/Linux
### END INIT INFO

# Author: me
#
# Wrapper-Script for PureMessage
#

PMX_INIT=/opt/pmx6/bin/pmx-init
NAME=puremessage
SCRIPTNAME=/etc/init.d/$NAME


case "$1" in
  start)
        $PMX_INIT start
        ;;
  stop)
        $PMX_INIT stop
        ;;
  status)
        $PMX_INIT status
        ;;
  restart)
        $PMX_INIT restart
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
        exit 3
        ;;
esac

exit 0

 At the end just call 'insserv pmx-postfix' and 'insserv puremessage' and the symlinks are created with respect to the dependencies given by the headers.

have fun

Ilja

:22961


This thread was automatically locked due to age.