I'm trying to add ZM as a service for when the server restarts etc.
While trying to use the script that comes with the ZM package, I get the following error on SUSE 9.1
/etc/rc.d/zm start
./zm: line 6: /etc/rc.d/init.d/functions: No such file or directory
with line 6 being
. /etc/rc.d/init.d/functions
I checked and there isn't a /etc/rc.d/init.d/functions file.
Anyone got this working on SUSE 9.1?
Otherwise everything else works as it should. I just have to start it by hand.
Thanks
Andrew
SUSE 9.1 Adding ZM as a service?
- lazyleopard
- Posts: 403
- Joined: Tue Mar 02, 2004 6:12 pm
- Location: Gloucestershire, UK
The scripts in init.d (wherever) tend to be very distribution-specific. You probably need to figure out how SuSE does init.d scripts, and then code one up for zoneminder. For my Debian(woody) system I've got this:Compare and contrast this with the zm script you've got, and the other scripts ininit.d, and maybe you'll be able to figure what to do.
Code: Select all
#! /bin/sh
# ZoneMinder init script
# Based on skeleton by Miquel van Smoorenburg and Ian Murdock
ZM_PATH_BIN="/usr/local/bin"
PATH="$ZM_PATH_BIN:/sbin:/bin:/usr/sbin:/usr/bin"
DAEMON="$ZM_PATH_BIN/zmpkg.pl"
NAME=zm
SNAME=zoneminder
DESC="Zone Minder Webcam Daemon"
# Defaults - don't touch, edit /etc/default/zoneminder
ENABLED=0
OPTIONS=""
test -f /etc/default/zoneminder && . /etc/default/zoneminder
test "$ENABLED" != "0" || exit 0
test -f $DAEMON || exit 0
# The rest is like (almost) any other init.d script...
case "$1" in
start)
echo -n "Starting $DESC: "
$DAEMON start
RETVAL=$?
[ $RETVAL = 0 ] || echo -n "check "
echo -n "$NAME "
$DAEMON status
exit $RETVAL
;;
stop)
echo -n "Stopping $DESC: "
$DAEMON stop
RETVAL=$?
[ $RETVAL = 0 ] || echo -n "check "
echo -n "$NAME "
$DAEMON status
exit $RETVAL
;;
restart|force-reload)
echo -n "Restarting $DESC: "
$DAEMON restart
RETVAL=$?
[ $RETVAL = 0 ] || echo -n "check "
echo -n "$NAME "
$DAEMON status
exit $RETVAL
;;
status)
echo -n "$DESC is "
$DAEMON status
;;
*)
N=/etc/init.d/$SNAME
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
Rick Hewett