Gentoo Init Script

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
User avatar
securiteaze
Posts: 25
Joined: Wed Jun 16, 2004 5:38 pm

Gentoo Init Script

Post 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
}
Post Reply