git.iko.soy/typeable/nixpkgs
on master help sign in
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

commit9159ca026d331f5790214655c6d75ef4cdd7edc4 authorArmijn Hemel <armijn@gpl-violations.org> dateFri 10 Mar 2006, 15:05 (21 years ago) parent6562861
2 files changed+10−2
pkgs/servers/server-scripts/generic/functions+8−2 pkgs/servers/syslog-script/syslog+2
pkgs/servers/server-scripts/generic/functions+8−2
@@ -42,14 +42,20 @@ start() {
4242 # launch all preferred dependencies
4343 #start_softdeps
4444 # launch our own program
45+ startService
46+ # if successful, then register
47+ register
4548}
4649
4750stop() {
51+ echo "stopping $prog"
4852 # are we running? If so, then stop, otherwise, do nothing...
49− if test -a $STATDIR/$prog = 0; then
53+ if ! test -a $STATEDIR/$prog; then
5054 exit 0
5155 fi
5256 # stop our own program
57+ stopService
58+ unregister
5359}
5460
5561register() {
@@ -62,7 +68,7 @@ unregister() {
6268
6369status() {
6470 # are we running? If so, report
65− if test -a $STATDIR/$prog; then
71+ if test -a $STATEDIR/$prog; then
6672 echo "running"
6773 else
6874 echo "stopped"
pkgs/servers/syslog-script/syslog+2
@@ -27,6 +27,8 @@ startService()
2727stopService()
2828{
2929 echo -n "Stopping $prog:"
30+ kill `cat /var/run/syslogd.pid`
31+ kill `cat /var/run/klogd.pid`
3032}
3133
3234reloadService()