Provide and install a zoneminder.service file to get zm running with systemd on debian jessie

This commit is contained in:
Emmanuel Papin 2014-11-25 23:50:46 +01:00
parent be420e65c4
commit 997ab779ac
2 changed files with 19 additions and 0 deletions

View File

@ -20,3 +20,4 @@ etc/zm
db/zm_create.sql usr/share/zoneminder/db
db/zm_update-*.sql usr/share/zoneminder/db
debian/apache.conf etc/zm
debian/zoneminder.service lib/systemd/system

View File

@ -0,0 +1,18 @@
# ZoneMinder systemd unit file
# This file is intended to work with debian distributions
[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mysql.service apache2.service
Requires=mysql.service apache2.service
[Service]
User=www-data
Type=forking
ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl restart
ExecStop=/bin/bash -c '[[ "$(/usr/bin/pgrep zmdc.pl)" > 0 ]] && /usr/bin/zmpkg.pl stop'
PIDFile=/var/run/zm/zm.pid
[Install]
WantedBy=multi-user.target