|
From: Artur P. <ag...@li...> - 2006-09-27 11:08:07
|
I use the script that came with debian in
(/usr/share/doc/motion/examples/motion.init-Debian)
Artur
--
#! /bin/bash
#
# motion Start the motion detection .
#
NAME=motion
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/bin/motion
PIDFILE=/var/run/$NAME.pid
trap "" 1
export LANG=C
export PATH
test -f $DAEMON || exit 0
case "$1" in
start)
echo "Starting motion detection : $NAME"
start-stop-daemon --start --make-pidfile --pidfile $PIDFILE --exec
$DAEMON
echo `ps axf | grep -v grep | grep $DAEMON | head -n1 | awk '{print
$1}'` > $PIDFILE
;;
stop)
echo "Stopping motion detection : $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo --exec $DAEMON
--retry 30
rm -rf $PIDFILE 2> /dev/null
;;
status)
echo "Status motion detection : $NAME"
if (test -f $PIDFILE); then
echo -n "Running process for $NAME : "
pidof $NAME
else
echo "Stopped"
fi
;;
reload-config)
echo "Reloading $NAME configuration"
start-stop-daemon --stop --pidfile $PIDFILE --signal HUP --exec $DAEMON
;;
restart-motion)
echo "Restarting $NAME"
start-stop-daemon --stop --pidfile $PIDFILE --oknodo --exec $DAEMON
--retry 30
rm -rf $PIDFILE 2> /dev/null
start-stop-daemon --start --make-pidfile --pidfile $PIDFILE --exec
$DAEMON
echo `ps axf | grep -v grep | grep $DAEMON | head -n1 | awk '{print
$1}'` > $PIDFILE
;;
restart)
$0 restart-motion
exit $?
;;
*)
echo "Usage: /etc/init.d/$NAME
{start|stop|status|reload-config|restart}"
exit 1
;;
esac
if [ $? == 0 ]; then
echo .
exit 0
else
echo failed
exit 1
fi
Peter Holik wrote:
>>> 9:23:respawn:start-stop-daemon --start --chuid motion --exec /usr/bin/motion -- -n -d 3
>>> -c /etc/motion/motion.conf
>>>
>> at which place?
>>
>
> at the end of /etc/inittab
>
> cu Peter
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Motion-user mailing list
> Mot...@li...
> https://lists.sourceforge.net/lists/listinfo/motion-user
> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
>
|