Re: [Vserver] Qmail inside vserver 2.0

From: GarconDuMonde <gdm_at_fifthhorseman.net>
Date: Thu 30 Mar 2006 - 23:00:37 BST
Message-ID: <442C5505.3010201@fifthhorseman.net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi

Timothy Arnold wrote:
> Just wondered if anyone has had any issues starting Qmail inside a vserver
> (2.0). I have a straight thing where Qmail will not start on "boot". The
> init script does run, but the daemons appear to crash. Once the vserver
> has started, I can login and run /etc/init.d/qmail start and it works.
>
> Some people have suggested that I change init, as I am using the standard
> Qmail start/stop script but I think that this might be more fundamental ?

i had trouble getting djbdns to work until a friend helped out. these are some
notes he wrote up - the problem was not with the djbdns but with the daemontools
supervisory processes, which i suspect may be similar for qmail (i have never
used qmail, so don't know exactly how it works):

<quote who="dkg">
getting daemontools to launch

Installing the daemontools packages adds the following line to /etc/inittab:

        SV:123456:respawn:/command/svscanboot

and then instructs the init process to rescan its file, which kicks off
svscanboot. svscanboot is the grandaddy process for all the daemons handled by
daemontools. it is responsible for kicking off svscan, which watches the
contents of /service, and launches a supervise process for each well-formed
configuration directory linked there.

on a vserver, there is no true init process running. the only init process is
the one which runs on the host. so modifying /etc/inittab in the vserver and
attempting to instruct init to rescan it did nothing.

however, when a vserver starts up, it does kick off the appropriate sysvinit
scripts for its desired runlevel. So i (dkg) wrote a simple
/etc/init.d/daemontools script to start and stop svscanboot. i based the script
off of /etc/init.d/skeleton.

that script looks something like:

#! /bin/sh
#
# daemontools for launching /etc/svscanboot from sysvinit instead of /sbin/init.
#
# author: dkg

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="daemontools"
NAME=svscanboot
DAEMON=/command/svscanboot

PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

#
# Function that starts the daemon/service.
#
d_start() {
        start-stop-daemon --start --background --make-pidfile --quiet --pidfile
$PIDFILE \
                --exec $DAEMON
}

#
# Function that stops the daemon/service.
#
d_stop() {
        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
                --name $NAME
        echo "not cleaning up svscan and readproctitle subprocesses
appropriately. dkg is lazy."
}

#
# Function that sends a SIGHUP to the daemon/service.
#
d_reload() {
        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
                --name $NAME --signal 1
}

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        d_start
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        d_stop
        echo "."
        ;;
  restart|force-reload)
        #
        # If the "reload" option is implemented, move the "force-reload"
        # option to the "reload" entry above. If not, "force-reload" is
        # just the same as "restart".
        #
        echo -n "Restarting $DESC: $NAME"
        d_stop
        sleep 1
        d_start
        echo "."
        ;;
  *)
        # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

This might well be the wrong way to go about it, but i'm not sure.
www.nongnu.org/util-vserver/doc/conf/configuration.html has some (unclear to me)
instructions about how to deal with the non-standard init situation under a
vserver. However, since the standard initscripts from the sysvinit runlevels
seemed to be working, and svscanboot (cr.yp.to/daemontools/svscanboot.html)
should never really need to restart, the simplest thing for me to do was to add
the initscript.

</quote>

- --

love and solidarity,

        --gdm

http://docs.indymedia.org/view/Main/GarconDuMonde

gpg id: 0x594B97C2

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Darwin)

iD8DBQFELFUCDiVJRFlLl8IRAnKwAKCEYeI3mhHJ01pIb5akFNPDnPX1KwCeN0aQ
hFt55fYt8CFCGyWPmwlb9aw=
=5i4Y
-----END PGP SIGNATURE-----
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Thu Mar 30 23:01:04 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 30 Mar 2006 - 23:01:12 BST by hypermail 2.1.8