SOURCES: motion.init - now restart is possible even if there are s...
blues
blues at pld-linux.org
Thu Mar 23 23:24:04 CET 2006
Author: blues Date: Thu Mar 23 22:24:03 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- now restart is possible even if there are some problems
---- Files affected:
SOURCES:
motion.init (1.2 -> 1.3)
---- Diffs:
================================================================
Index: SOURCES/motion.init
diff -u SOURCES/motion.init:1.2 SOURCES/motion.init:1.3
--- SOURCES/motion.init:1.2 Thu Mar 23 21:35:15 2006
+++ SOURCES/motion.init Thu Mar 23 23:23:57 2006
@@ -11,7 +11,7 @@
. /etc/rc.d/init.d/functions
# Initial values:
-motion=${MOTION-//usr/bin/motion}
+motion=${MOTION-/usr/bin/motion}
STARTUP_OPTIONS=""
PIDFILE=/var/run/motion.pid
@@ -24,10 +24,10 @@
start)
if [ ! -f /var/lock/subsys/motion ]; then
msg_starting motion
- daemon $motion ${STARTUP_OPTIONS}
+ daemon ${motion} ${STARTUP_OPTIONS}
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
- echo `ps axf | grep -v grep | grep $motion | head -n1 | awk '{print $1}'` > $PIDFILE
+ echo `ps axf | grep -v grep | grep ${motion} | head -n1 | awk '{print $1}'` > ${PIDFILE}
touch /var/lock/subsys/motion
fi
else
@@ -37,17 +37,15 @@
stop)
if [ -f /var/lock/subsys/motion ]; then
msg_stopping motion
- killproc motion
+ killproc --pidfile ${PIDFILE} motion
RETVAL=$?
- if [ $RETVAL -eq 0 ] ; then
- rm -f /var/lock/subsys/motion /var/run/motion.pid
- fi
+ rm -f /var/lock/subsys/motion ${PIDFILE}
else
msg_not_running motion
fi
;;
status)
- status $motion
+ status motion
RETVAL=$?
;;
restart|force-reload)
@@ -58,7 +56,7 @@
reload)
if [ -f /var/lock/subsys/motion ]; then
msg_reloading motion
- killproc motion -HUP
+ killproc --pidfile ${PIDFILE} motion -HUP
RETVAL=$?
else
msg_not_running motion >&2
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/motion.init?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list