Systemd Startup CentOS 7
Posted: Tue Oct 07, 2014 5:34 pm
I've got my cameras running fine, but I can't seem to get the them to start on boot. I have to go into the web interface and change the state to Start to get the cameras running. I made a systemd service and it appears to stop and start all the processes that the web interface does, but the cameras still don't come up. Interestingly, once I change the state in the web interface I can then use the systemd service I made to stop and start the cameras correctly. So I thought there must be something in the database that's getting changed that the systemd service isn't doing, but I logged all the queries and no inserts or updates except to the Log table. Any ideas on what I should look at next?
Processes started by both methods:
apache 4415 0.0 0.5 284924 10504 pts/0 S 12:08 0:00 /usr/bin/perl -wT /usr/local/bin/zmdc.pl startup
apache 4441 2.2 3.0 322044 56480 pts/0 S 12:08 0:26 /usr/local/bin/zmc -m 1
apache 4450 2.0 3.0 323092 57536 pts/0 S 12:08 0:24 /usr/local/bin/zmc -m 2
apache 4459 2.3 3.0 323384 57800 pts/0 S 12:08 0:27 /usr/local/bin/zmc -m 3
apache 4468 0.0 1.1 298380 22480 pts/0 S 12:08 0:00 /usr/bin/perl -wT /usr/local/bin/zmfilter.pl
apache 4476 0.0 0.7 288228 14296 pts/0 S 12:08 0:00 /usr/bin/perl -wT /usr/local/bin/zmaudit.pl -c
apache 4489 0.0 0.6 284520 12784 pts/0 S 12:08 0:00 /usr/bin/perl -wT /usr/local/bin/zmwatch.pl
apache 4499 0.0 0.8 285188 15692 pts/0 S 12:08 0:00 /usr/bin/perl -w /usr/local/bin/zmupdate.pl -c
Here is my systemd service file:
[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mariadb.service httpd.service
Requires=mariadb.service httpd.service
[Service]
User=apache
Type=forking
ExecStart=/usr/local/bin/zmpkg.pl start
ExecReload=/usr/local/bin/zmpkg.pl restart
ExecStop=/usr/local/bin/zmdc.pl shutdown
PIDFile="/var/run/zm/zm.pid"
[Install]
WantedBy=multi-user.target
Processes started by both methods:
apache 4415 0.0 0.5 284924 10504 pts/0 S 12:08 0:00 /usr/bin/perl -wT /usr/local/bin/zmdc.pl startup
apache 4441 2.2 3.0 322044 56480 pts/0 S 12:08 0:26 /usr/local/bin/zmc -m 1
apache 4450 2.0 3.0 323092 57536 pts/0 S 12:08 0:24 /usr/local/bin/zmc -m 2
apache 4459 2.3 3.0 323384 57800 pts/0 S 12:08 0:27 /usr/local/bin/zmc -m 3
apache 4468 0.0 1.1 298380 22480 pts/0 S 12:08 0:00 /usr/bin/perl -wT /usr/local/bin/zmfilter.pl
apache 4476 0.0 0.7 288228 14296 pts/0 S 12:08 0:00 /usr/bin/perl -wT /usr/local/bin/zmaudit.pl -c
apache 4489 0.0 0.6 284520 12784 pts/0 S 12:08 0:00 /usr/bin/perl -wT /usr/local/bin/zmwatch.pl
apache 4499 0.0 0.8 285188 15692 pts/0 S 12:08 0:00 /usr/bin/perl -w /usr/local/bin/zmupdate.pl -c
Here is my systemd service file:
[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mariadb.service httpd.service
Requires=mariadb.service httpd.service
[Service]
User=apache
Type=forking
ExecStart=/usr/local/bin/zmpkg.pl start
ExecReload=/usr/local/bin/zmpkg.pl restart
ExecStop=/usr/local/bin/zmdc.pl shutdown
PIDFile="/var/run/zm/zm.pid"
[Install]
WantedBy=multi-user.target