From 9159ca026d331f5790214655c6d75ef4cdd7edc4 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Fri, 10 Mar 2006 15:05:22 +0000 Subject: [PATCH] make syslog work with our new start/stop scripts. It is still full of race conditions and dependencies don't work yet, but it's a start svn path=/nixpkgs/trunk/; revision=5023 --- pkgs/servers/server-scripts/generic/functions | 10 ++++++++-- pkgs/servers/syslog-script/syslog | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/server-scripts/generic/functions b/pkgs/servers/server-scripts/generic/functions index 48c6a4d0d7b9..42b13704ae44 100644 --- a/pkgs/servers/server-scripts/generic/functions +++ b/pkgs/servers/server-scripts/generic/functions @@ -42,14 +42,20 @@ start() { # launch all preferred dependencies #start_softdeps # launch our own program + startService + # if successful, then register + register } stop() { + echo "stopping $prog" # are we running? If so, then stop, otherwise, do nothing... - if test -a $STATDIR/$prog = 0; then + if ! test -a $STATEDIR/$prog; then exit 0 fi # stop our own program + stopService + unregister } register() { @@ -62,7 +68,7 @@ unregister() { status() { # are we running? If so, report - if test -a $STATDIR/$prog; then + if test -a $STATEDIR/$prog; then echo "running" else echo "stopped" diff --git a/pkgs/servers/syslog-script/syslog b/pkgs/servers/syslog-script/syslog index 3ec29884c1d5..d6291271f48a 100755 --- a/pkgs/servers/syslog-script/syslog +++ b/pkgs/servers/syslog-script/syslog @@ -27,6 +27,8 @@ startService() stopService() { echo -n "Stopping $prog:" + kill `cat /var/run/syslogd.pid` + kill `cat /var/run/klogd.pid` } reloadService()