[opensuse] sqlgrey won't start
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? Thanks Hans #!/bin/sh # # sqlgrey: Init script for sqlgrey postfix policy service # # chkconfig: 345 90 10 # description: SQLgrey is a postfix grey-listing policy service. # pidfile: /var/run/sqlgrey.pid # Source function library. #. /etc/init.d/functions # See how we were called. case "$1" in start) echo -n "Starting SQLgrey: " # SQLite put files in the working directory cd ~sqlgrey sqlgrey -d # echo_success echo ;; stop) echo -n "Shutting down SQLgrey: " sqlgrey -k # echo_success echo ;; status) status sqlgrey ;; restart) $0 stop sleep 1 # hack: missing REUSEADDR from Net::Server? $0 start ;; *) echo "Usage: sqlgrey {start|stop|status|restart}" exit 1 esac exit 0 --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 11 November 2006 23:37, Hans du Plooy wrote:
Does anyone know why it wouldn't start?
what is the output of "chkconfig sqlgrey"? darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Marcus Rueckert wrote:
On Saturday 11 November 2006 23:37, Hans du Plooy wrote:
Does anyone know why it wouldn't start?
what is the output of "chkconfig sqlgrey"?
and what is the message when you try to start it by hand? J --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 2006-11-11 at 18:13 -0800, J Sloan wrote:
and what is the message when you try to start it by hand?
It starts normally without any problems. That's what's messing with my head. Hans --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2006-11-12 at 03:02 +0100, Marcus Rueckert wrote:
On Saturday 11 November 2006 23:37, Hans du Plooy wrote:
Does anyone know why it wouldn't start?
what is the output of "chkconfig sqlgrey"?
nemo:~ # chkconfig sqlgrey sqlgrey off So I do: nemo:~ # insserv sqlgrey nemo:~ # chkconfig sqlgrey sqlgrey on Right, but now I have another problem: nemo:/etc/init.d/rc3.d # ls -lh [snip] lrwxrwxrwx 1 root root 10 Nov 12 04:16 S01sqlgrey -> ../sqlgrey [snip] lrwxrwxrwx 1 root root 8 Nov 1 13:22 S12mysql -> ../mysql Because mysql isn't started yet, sqlgrey fails to start. That's why I changed the symlink from S01 to S99 - so that it starts last. But it still doesn't start. No output in the logs either. I added this to the init script (took an example from one of the SUSE-supplied scripts - don't know if I'm doing this right): # Required-Start: $network $syslog $mysql insserv -r sqlgrey insserv sqlgrey But it still makes it S01sqlgrey. Oh I forgot, in my original post, the reason why I mentioned Debian is because it starts fine on the Debian servers. All I did there was make the symlink by hand, so I don't understand why it fails on SUSE. Any ideas? Thanks Hans --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 12 November 2006 03:24, Hans du Plooy wrote:
# Required-Start: $network $syslog $mysql
Try "mysql", instead of "$mysql".
insserv -r sqlgrey insserv sqlgrey
But it still makes it S01sqlgrey. Oh I forgot, in my original post, the reason why I mentioned Debian is because it starts fine on the Debian servers. All I did there was make the symlink by hand, so I don't understand why it fails on SUSE.
Any ideas?
To make SLES respect the symlinks, change RUN_PARALLEL to "no" in /etc/sysconfig/boot. When startpar is used, the symlinks are ignored --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Sunday 2006-11-12 at 04:24 +0200, Hans du Plooy wrote:
So I do:
nemo:~ # insserv sqlgrey nemo:~ # chkconfig sqlgrey sqlgrey on
Right, but now I have another problem:
nemo:/etc/init.d/rc3.d # ls -lh [snip] lrwxrwxrwx 1 root root 10 Nov 12 04:16 S01sqlgrey -> ../sqlgrey [snip] lrwxrwxrwx 1 root root 8 Nov 1 13:22 S12mysql -> ../mysql
You haven't defined the info section: ### BEGIN INIT INFO ... See man init.d, less /etc/init.d/skeleton, admin book, etc.
Because mysql isn't started yet, sqlgrey fails to start. That's why I changed the symlink from S01 to S99 - so that it starts last. But it still doesn't start. No output in the logs either.
Of course, no entry in the makefile and .depend.* files.
I added this to the init script (took an example from one of the SUSE-supplied scripts - don't know if I'm doing this right):
# Required-Start: $network $syslog $mysql
You have to enter the whole section. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFVxV1tTMYHG2NR9URAnjdAKCCbfbIDC7HfnQ/XCFkeZkqq5kRgwCghO1g FOdm0+BPaOi/GXFHku77vUc= =O1Bd -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2006-11-12 at 04:24 +0200, Hans du Plooy wrote:
On Sun, 2006-11-12 at 03:02 +0100, Marcus Rueckert wrote:
On Saturday 11 November 2006 23:37, Hans du Plooy wrote:
Does anyone know why it wouldn't start?
Thanks to all who replied. After I sent my last mail I tried: insserv sqlgrey mv S01sqlgrey S99sqlgrey reboot And it came up with sqlgrey running. I have no idea why that changed anything, but it seems to be working. I'll look into the extra stuff for dependancies (Thanks Carlos) just to be sure. Thanks Hans --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hans du Plooy wrote:
On Sun, 2006-11-12 at 04:24 +0200, Hans du Plooy wrote:
On Sun, 2006-11-12 at 03:02 +0100, Marcus Rueckert wrote:
On Saturday 11 November 2006 23:37, Hans du Plooy wrote:
Does anyone know why it wouldn't start?
Thanks to all who replied. After I sent my last mail I tried:
insserv sqlgrey
mv S01sqlgrey S99sqlgrey
reboot
The excessive rebooting seems odd - why not just change runlevels, if you really need to make sure that services start automatically? J --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2006-11-12 at 12:11 -0800, J Sloan wrote:
The excessive rebooting seems odd - why not just change runlevels, if you really need to make sure that services start automatically?
Because it starts normaly after boot, but not during boot. That was the original problem. Hans --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hans du Plooy wrote:
On Sun, 2006-11-12 at 12:11 -0800, J Sloan wrote:
The excessive rebooting seems odd - why not just change runlevels, if you really need to make sure that services start automatically?
Because it starts normaly after boot, but not during boot. That was the original problem.
init 1 init 3 would test that process without a reboot per se... J --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2006-11-12 at 14:59 -0800, J Sloan wrote:
Because it starts normaly after boot, but not during boot. That was the original problem.
init 1 init 3
would test that process without a reboot per se...
I suppose, but either ways takes long enough (most of these boxes are Pentium or Pentium-II) to go make another cup of coffee :-) But usually when testing I try to replacte circumstances exactly. What happens is long power outages, much longer than most UPS systems that small companies buy will last. So fresh boots occurs much more often than I'd like. Hans --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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
participants (5)
-
Anders Johansson
-
Carlos E. R.
-
Hans du Plooy
-
J Sloan
-
Marcus Rueckert