# netqmail supervise scripts

## therealjrd

Sorry if there's a better place to post this, seemed like as good a fit as any.

I'm just commisioning a couple of new servers with netqmail.  svc fails to start it, as /var/qmail-send/supervise (due to symlinks, really /var/qmail/supervise/qmail-send/supervise) doesn't exist.  Same goes for qmail-smtpd and some other stuff.  

I have an older machine also with netqmail-1.06, which works fine.  I believe I followed http://www.gentoo.org/doc/en/qmail-howto.xml on all these hosts, but reviewing it again now, I don't see a mention of creating those dirs for svc.  equery on both new and old machines doesn't claim a package own that stuff, so it probably is meant to get created by some script or something.

I've probably braino'ed something, but it's not obvious (by definition) what.  Hints?  What's supposed to set up the supervise infrastructure for qmail daemons?

Thanks in advance...

----------

## wcg

 *Quote:*   

> /var/qmail/supervise/qmail-send/supervise

 

It seems like you would just have a "run" command  and log/ directory

in /var/qmail/supervise/qmail-send/. (One too many levels of subdirectory

there). Then symlink /var/qmail/supervise/qmail-send/ to a subdirectory

under /service/, so that svscan finds it when svscan is started at boot.

You also need to add svscan to the services started at boot with

rc-update.

(The run command has the path to wherever the qmail-send binary is located.)

You could install the daemontools and qmail sources from http://cr.yp.to/

to see how the default "make install" arranges things. daemontools

binaries end up in /command/ and IIRC qmail binaries end up in a

subdirectory of /var/qmail/, so they should not collide with the Gentoo

packages, which tend to keep binaries in /usr/bin/, /usr/sbin/, etc, and

start svscan from a script in /etc/init.d/ rather than from /etc/inittab.

If you have existing /var/qmail/ and /service/ directories with content,

move them out of the way first, and copy /etc/inittab to /etc/inittab.Gentoo

first, so you can put it back less the daemontools "make install" edit

afterwards.

----------

## wcg

So, having some time, I looked at an old (kernel 2.4) Slackware

directory setup for qmail. It started with a "/var/qmail/rc" file

(a shell script) that simply ran /var/qmail/bin/qmail-start with an

argument to check the mail aliases database with fastforward and

another argument to log with multilog (from the daemontools

package). It started from one of the Slackware /etc/rc.d/* scripts

that run when you change into different runlevels. Here is the content

of /var/qmail/rc:

```

#!/bin/sh

# Using qmail-local to deliver messages to ~/Mailbox by default.

QBIN=/var/qmail/bin

DBIN=/command # daemontools

if [ -x ${QBIN}/qmail-start ]; then

  if [ -x ${DBIN}/multilog ]; then

    ${QBIN}/qmail-start '|fastforward -d /etc/aliases.cdb' \

      ${DBIN}/multilog t /var/log/mail/qmail_send &

  else

     echo

     echo "${DBIN}/multilog not found or not executable"

  fi

else

  echo

  echo "${QBIN}/qmail-start not found or not executable"

fi

```

(It should have checked for fastforward, too, found in /var/qmail/bin/.)

qmail-start is C code. One would need to look at the source to see

what all it started in daemon mode, sleeping in memory and listening

to a port (qmail-smtpd) or some pipe (local delivery agent, etc).

That installation did not integrate qmail with svscan, supervise, and

svc. (They were installed but were not managing the qmail smtp daemon

or other qmail utilities.)

Apparently there is a newer way that enables supervise to monitor

qmail-smtpd:

http://rod.info/HowToGentoo

----------

