Commit f7bfaef6 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Try to handle missing etc/pid file.

parent c093fe55
#!/bin/sh #!/bin/sh
case "$1"x in case "$1"x in
x) x)
echo foo;; if [ -f @ETCDIR@/status ]
then
if [ ! -f @ETCDIR@/pid ]
then
echo 'LysKOM is probably DOWN (pid file not found)'
elif kill -0 `cat @ETCDIR@/pid`
then
echo 'LysKOM is going down'
ps u`cat @ETCDIR@/pid` || echo 'Apparently just died.'
else
echo 'LysKOM is DOWN'
fi
ls -l @ETCDIR@/status
else
if [ ! -f @ETCDIR@/pid ]
then
echo 'LysKOM is probably going up (pid file not found)'
elif kill -0 `cat @ETCDIR@/pid`
then
echo 'LysKOM is UP'
ps u`cat @ETCDIR@/pid` || echo 'Apparently just died.'
else
echo 'LysKOM is going up'
fi
fi;;
onx|upx|startx) onx|upx|startx)
rm -f @ETCDIR@/status rm -f @ETCDIR@/status
if kill -HUP `cat @ETCDIR@/pid` if kill -HUP `cat @ETCDIR@/pid`
...@@ -10,4 +34,5 @@ case "$1"x in ...@@ -10,4 +34,5 @@ case "$1"x in
fi;; fi;;
offx|downx|shutdownx) offx|downx|shutdownx)
whoami > @ETCDIR@/status whoami > @ETCDIR@/status
kill -HUP `cat @ETCDIR@/pid` kill -HUP `cat @ETCDIR@/pid`;;
esac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment