Greetings,
I have a redhat 9 system running a version .77 Shupp toaster. I found a
script which I use with daemontools-handled services which works great for
me; makes things 'feel' like sys-V style. Found it at
http://www.lifewithdjbdns.com/#SysV-style%20init%20script
I would recommend it to other users running daemontools-supervised services;
however I have trouble with the log service scripts (eg.
/service/qmail-pop3d/log/) - they won't come back up after a
]# /etc/init.d/svscan restart
Here is an example session transaction illustrating what I mean:
----------------------------------------------------------------------------
------
]# ps -ef f
root 1599 1 0 02:19 ? S 0:00 /bin/sh
/command/svscanboot
root 1601 1599 0 02:19 ? S 0:00 \_ svscan /service
root 1603 1601 0 02:19 ? S 0:00 | \_ supervise
qmail-send
qmails 1614 1603 0 02:19 ? S 0:00 | | \_ qmail-send
root 1626 1614 0 02:19 ? S 0:00 | | \_
qmail-lspawn ./Maildir/
qmailr 1627 1614 0 02:19 ? S 0:00 | | \_
qmail-rspawn
qmailq 1628 1614 0 02:19 ? S 0:00 | | \_
qmail-clean
root 1604 1601 0 02:19 ? S 0:00 | \_ supervise log
qmaill 1613 1604 0 02:19 ? S 0:00 | | \_
/usr/local/bin/multilog t s5000000 /var/log/qmail
root 1605 1601 0 02:19 ? S 0:00 | \_ supervise
qmail-smtpd
vpopmail 1629 1605 0 02:19 ? S 0:00 | | \_
/usr/local/bin/tcpserver -v -H -R -l 0 -x /home/vpopmail/etc/tcp.smtp
root 1606 1601 0 02:19 ? S 0:00 | \_ supervise log
qmaill 1630 1606 0 02:19 ? S 0:00 | | \_
/usr/local/bin/multilog t /var/log/qmail/smtpd
root 1607 1601 0 02:19 ? S 0:00 | \_ supervise
qmail-pop3d
vpopmail 1615 1607 0 02:19 ? S 0:00 | | \_
/usr/local/bin/tcpserver -l 0 -R -H -v -u89 -g89 0 110 /var/qmail/bin
root 1608 1601 0 02:19 ? S 0:00 | \_ supervise log
qmaill 1698 1608 0 02:21 ? S 0:00 | | \_ multilog t
/var/log/qmail/pop3d
root 1609 1601 0 02:19 ? S 0:00 | \_ supervise
qmail-pop3ds
vpopmail 1617 1609 0 02:19 ? S 0:00 | | \_
/usr/local/bin/tcpserver -l 0 -R -H -v -u89 -g89 0 995 /usr/sbin/stun
root 1610 1601 0 02:19 ? S 0:00 | \_ supervise log
qmaill 1633 1610 0 02:19 ? S 0:00 | | \_ multilog t
/var/log/qmail/pop3ds
root 1611 1601 0 02:19 ? S 0:00 | \_ supervise clamd
clamav 1631 1611 0 02:19 ? S 0:03 | | \_
/usr/local/sbin/clamd
root 1612 1601 0 02:19 ? S 0:00 | \_ supervise log
clamav 1623 1612 0 02:19 ? S 0:00 | \_
/usr/local/bin/multilog t /var/log/clamd
root 1602 1599 0 02:19 ? S 0:00 \_ readproctitle service
errors: ...............................................
]# svstat /service/qmail-pop3d/log
/service/qmail-pop3d/log: up (pid 1698) 790 seconds
]# svstat /service/qmail-pop3d/log
/service/qmail-pop3d/log: down 10 seconds, normally up
]# svc -u /service/qmail-pop3d/log/
]# svstat /service/qmail-pop3d/log
/service/qmail-pop3d/log: up (pid 2021) 3 seconds
]# service svscan status
svscan (pid 1601) is running...
/service/clamd: up (pid 1631) 1000 seconds
/service/qmail-pop3d: up (pid 1615) 1000 seconds
/service/qmail-pop3ds: up (pid 1617) 1000 seconds
/service/qmail-send: up (pid 1614) 1000 seconds
/service/qmail-smtpd: up (pid 1629) 1000 seconds
...so far so good...
]# service svscan restart
Shutting down svscan: [ OK ]
Ending supervision of service clamd: [ OK ]
Stopping service clamd: [ OK ]
Ending supervision of service qmail-pop3d: [ OK ]
Stopping service qmail-pop3d: [ OK ]
Ending supervision of service qmail-pop3ds: [ OK ]
Stopping service qmail-pop3ds: [ OK ]
Ending supervision of service qmail-send: [ OK ]
Ending supervision of service log qmail-send: [ OK ]
Stopping service qmail-send: [ OK ]
Stopping service log qmail-send: [ OK ]
Ending supervision of service qmail-smtpd: [ OK ]
Ending supervision of service log qmail-smtpd: [ OK ]
Stopping service qmail-smtpd: [ OK ]
Stopping service log qmail-smtpd: [ OK ]
Starting svscan: [ OK ]
]# svstat /service/qmail-pop3d
/service/qmail-pop3d: up (pid 2155) 10 seconds
]# svstat /service/qmail-pop3d/log
/service/qmail-pop3d/log: up (pid 2438) 0 seconds
/* ...uh-oh... */
]# ps -ef f
root 1599 1 0 02:19 ? S 0:00 /bin/sh
/command/svscanboot
root 1602 1599 0 02:19 ? S 0:00 \_ readproctitle service
errors: ...............................................
root 1608 1 0 02:19 ? S 0:00 supervise log
qmaill 2505 1608 1 02:38 ? Z 0:00 \_ [multilog <defunct>]
root 1610 1 0 02:19 ? S 0:00 supervise log
qmaill 2507 1610 1 02:38 ? Z 0:00 \_ [multilog <defunct>]
root 1612 1 0 02:19 ? S 0:00 supervise log
clamav 2506 1612 1 02:38 ? Z 0:00 \_ [multilog <defunct>]
root 2139 1 0 02:36 pts/0 S 0:00 /usr/local/bin/svscan
root 2140 2139 0 02:36 pts/0 S 0:00 \_ supervise qmail-send
qmails 2141 2140 0 02:36 pts/0 S 0:00 | \_ qmail-send
root 2147 2141 0 02:36 pts/0 S 0:00 | \_ qmail-lspawn
./Maildir/
qmailr 2148 2141 0 02:36 pts/0 S 0:00 | \_ qmail-rspawn
qmailq 2149 2141 0 02:36 pts/0 S 0:00 | \_ qmail-clean
root 2143 2139 0 02:36 pts/0 S 0:00 \_ supervise log
qmaill 2144 2143 0 02:36 pts/0 S 0:00 | \_
/usr/local/bin/multilog t s5000000 /var/log/qmail
root 2145 2139 0 02:36 pts/0 S 0:00 \_ supervise qmail-smtpd
vpopmail 2150 2145 0 02:36 pts/0 S 0:00 | \_
/usr/local/bin/tcpserver -v -H -R -l 0 -x /home/vpopmail/etc/tcp.smtp.cdb
root 2146 2139 0 02:36 pts/0 S 0:00 \_ supervise log
qmaill 2164 2146 0 02:36 pts/0 S 0:00 | \_
/usr/local/bin/multilog t /var/log/qmail/smtpd
root 2154 2139 0 02:36 pts/0 S 0:00 \_ supervise qmail-pop3d
vpopmail 2155 2154 0 02:36 pts/0 S 0:00 | \_
/usr/local/bin/tcpserver -l 0 -R -H -v -u89 -g89 0 110 /var/qmail/bin/qma
root 2159 2139 0 02:36 pts/0 S 0:00 \_ supervise
qmail-pop3ds
vpopmail 2160 2159 0 02:36 pts/0 S 0:00 | \_
/usr/local/bin/tcpserver -l 0 -R -H -v -u89 -g89 0 995 /usr/sbin/stunnel
root 2165 2139 0 02:36 pts/0 S 0:00 \_ supervise clamd
clamav 2166 2165 4 02:36 pts/0 S 0:03 | \_
/usr/local/sbin/clamd
root 2493 2139 0 02:38 pts/0 Z 0:00 \_ [supervise <defunct>]
root 2494 2139 0 02:38 pts/0 Z 0:00 \_ [supervise <defunct>]
root 2495 2139 0 02:38 pts/0 Z 0:00 \_ [supervise <defunct>]
----------------------------------------------------------------------------
------
I killed my log processes... and I can't get them back.
I know this is a special-case script (I will post the contents of it
underneath) but I often, in testing, and just over time, manage to kill one
or other of my log services, and I can never get them running again - I
always have to reboot !?! I wish I could find what stops
/service/qmail-pop3d/log and /service/qmail-pop3ds/log from starting. They
just keep starting, exiting, and starting again endlessly. I have been over
all DJB's recommendations and other qmail guides on daemontools, but I can't
find a lock file or anything obvious like that.
Can anybody tell me how I might go about getting my log services restarted
in this situation, without a reboot? FYI I have:
SV:123456:respawn:/command/svscanboot
at the end of /etc/inittab
And, as promised, here is my /etc/init.d/svscan
----------------------------------------------------------------------------
------
#!/bin/sh
#
# svscan Start and stop the svscan daemon.
#
# description: svscan is a general-purpose service manager, handling \
# execution of daemons, and ensuring their operation.
# processname: svscan
# Source function library.
. /etc/rc.d/init.d/functions
SERVICESDIR='/service'
BINDIR='/usr/local/bin'
LOCKDIR='/var/lock/subsys'
PATH=$PATH:$BINDIR
[ -f $BINDIR/svscan ] || exit 0
[ -d $SERVICESDIR ] || exit 0
RETVAL=0
# See how we were called.
case "$1" in
start)
# Start svscan.
action 'Starting svscan:' "/bin/sh -c '( cd $SERVICESDIR && exec
$BINDIR/svscan ) &'"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCKDIR/svscan
;;
stop)
# Stop svscan.
echo -n "Shutting down svscan:"
killproc svscan
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $LOCKDIR/svscan
# Stop supervised services. Do this last, so that
# svscan doesn't restart them.
x="$allow_null_glob_expansion"
allow_null_glob_expansion=1
for service in $SERVICESDIR/*
do
$BINDIR/svok $service || continue
action "Ending supervision of service `basename $service`:"
"$BINDIR/svc -x $service"
[ -k $service ] && action "Ending supervision of service log
`basename $service`:" "$BINDIR/svc -x $service/log"
action "Stopping service `basename $service`:" "$BINDIR/svc -d
$service"
[ -k $service ] && action "Stopping service log `basename
$service`:" "$BINDIR/svc -d $service/log"
done
allow_null_glob_expansion="$x"
;;
status)
status svscan
RETVAL=$?
x="$allow_null_glob_expansion"
allow_null_glob_expansion=1
for service in $SERVICESDIR/*
do
$BINDIR/svstat $service
done
allow_null_glob_expansion="$x"
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
*)
echo "Usage: svscan {start|stop|restart|reload|status}"
exit 1
esac
exit $RETVAL
----------------------------------------------------------------------------
------
Sorry for the huge post; trying to be as clear/detailed as possible.
Regards,
David Branford
Aternox Design
www.aternoxdesign.com.au
<[EMAIL PROTECTED]>