Hans du Plooy wrote:
> Hi guys,
>
> I'm seeing something weird. I maintain a fair number of mailservers at
> clients' sites. Some are Debian Sarge, but most are some version of
> SUSE from 9.1 though 10.1 as well as SLES9. On all of them I run
> postfix with amavisd-new and sqlgrey (http://sqlgrey.sourceforge.net/).
> sqlgrey has a simple startup script - see below - that I put
> in /etc/init.d/
>
> For some reason, on all the SUSE machines, sqlgrey don't start at boot.
> I have used insserv to add it to the runlevel, I've made symlinks by
> hand to S99 to make sure it starts after the stuff it depends on, I've
> en put it in boot.local. Reboot the box, and again, it's not started.
> But when I start it by hand, it starts normally.
>
> I haven't been able to go to one of them and see what comes up on the
> screen - most of them can't be switched off during business hours.
>
> Does anyone know why it wouldn't start?
OK, never mind, I didn't read the original message. Darix is exactly right.
messing around with symlinks is error prone and tedious, I just use the suse
mechanisms already in place, and let the system do the grunt work.
Here is the rc script I use - drop it in /etc/init.d/, make a symlink to
/usr/sbin/rcsqlgrey, and run chkconfig -a sqlgrey.
Starts every time - not that I ever reboot, but those times when power
failures have occurred, everything always comes up running as it should.
J
#!/bin/sh
#
# Copyright (c) 2000-2006 Mirai Consulting 2001-2003
# Author: Viktor Vogel <[EMAIL PROTECTED]> for SuSE 10.0
#
# sqlgrey
#
# /etc/init.d/sqlgrey
#
### BEGIN INIT INFO
# Provides: sqlgrey
# Required-Start:
# X-UnitedLinux-Should-Start: $ALL $portmap ipsec named dhcpd
# Required-Stop:
# X-UnitedLinux-Should-Stop: $ALL
# Default-Start: 3 4 5
# Default-Stop:
# Short-Description: sqlgrey
# Description: sqlgrey implements greylisting service for postfix
### END INIT INFO
SQLGREY=/usr/sbin/sqlgrey
STARTOPTS=' -d'
KILLOPTS=' -k'
SGCFG=/etc/sqlgrey/sqlgrey.conf
SGPIDFILE=/var/run/sqlgrey/pidfile
. /etc/rc.status
rc_reset
# See how we were called.
case "$1" in
start)
echo -n "Starting sqlgrey "
rc_status -v
cd ~sqlgrey
$SQLGREY $STARTOPTS
;;
stop)
echo -n "Shutting down sqlgrey "
rc_status -v
$SQLGREY $KILLOPTS
;;
restart)
rc_status -v
$0 stop
sleep 1
$0 start
;;
status)
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
rc_exit