zoneminder not started on system reboot

Forum for questions and support relating to the 1.24.x releases only.
Locked
dmb2002man
Posts: 28
Joined: Thu Nov 04, 2010 2:39 pm

zoneminder not started on system reboot

Post by dmb2002man »

hello,

everytime i reboot my ubuntu i have to start zoneminder. How can i make zoneminder start on boot up. I have done all this but still not starting.

Make sure ZoneMinder starts automatically

* create new file as follows:

nano -w /etc/init.d/zm

now inside nano paste the following:

#!/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

Make /etc/init.d/zm executable:

chmod 755 /etc/init.d/zm

* now: i use webmin to make ZoneMinder start at boot time ... (under webmin > system > bootup and shutdown > click zm and enable boot start, save)

* you may want to add the following line on /etc/rc.local file:

/etc/init.d/zm start
Locked