Starting Script is Not Working [SOLVED]

Forum for questions and support relating to the 1.24.x releases only.
Locked
sunucu
Posts: 13
Joined: Fri May 02, 2008 11:02 am

Starting Script is Not Working [SOLVED]

Post by sunucu »

I've wrote: locate zmpkg.pl
/usr/local/bin/zmpkg.pl
ls -l /etc/init.d/zm
-rwxr-xr-x 1 root root 826 2009-12-13 13:56 /etc/init.d/zm
cat /etc/init.d/zm
#!/bin/sh
# description: Control ZoneMinder as a Service
# chkconfig: 2345 99 99

# Source function library.
#. /etc/rc.d/init.d/functions

prog=ZoneMinder
ZM_PATH_BIN="/usr/local/bin"
command="$ZM_PATH_BIN/zmpkg.pl"

start() {
echo -n "Starting $prog: "
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
return $RETVAL
}
stop() {
echo -n "Stopping $prog: "
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo "ZoneMinder is running"
RETVAL=0
else
echo "ZoneMinder is stopped"
RETVAL=1
fi
}

case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
'status')
status
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
Yes there is. But still, i have to start zm manually from web interface. What's wrong there? And i counld not understand, what does the $RETVAL do? :roll:


Edit: The solution is there
Last edited by sunucu on Wed Dec 23, 2009 12:35 am, edited 1 time in total.
OSVER: Ubuntu Server 9.10 Karmic
ZMVER: ZoneMinder 1.24.2
DEVICE: Conexant CX23881 (4 Channel) with 2 CCD cams.
VIDEO: GeForce 9400GT 1GB (non-shared)
RAM: 1GB DDR2
CPU: Intel Pentium Dual 2.00GHz
User avatar
mmi
Posts: 111
Joined: Wed Jun 27, 2007 12:54 am

Post by mmi »

i have the same problem
Locked