Page 1 of 1

Gentoo Init Script

Posted: Tue Nov 30, 2004 11:55 pm
by securiteaze
Save this code as /etc/init.d/zm on a gentoo system. There is probably a better way to handle the pid ... but I thought it works well enough to post it here.

Code: Select all

#!/sbin/runscript
# Gentoo init script for ZoneMinder
# securiteaze@gmail.com

depend() {
        need apache2
        need mysql
        need net
        use logger
}
start() {
        ebegin "Starting ZoneMinder"
        start-stop-daemon --start --quiet --pidfile /var/run/zm.pid --make-pidfile --exec /usr/bin/zmpkg.pl -- start
        eend $?
}
stop() {
        ebegin "Stopping ZoneMinder"
        start-stop-daemon --start --quiet --exec /usr/bin/zmpkg.pl -- stop &&
        rm /var/run/zm.pid &&
        eend 0 ||
        eend 1
}