Zoneminder service times out a few minutes after starting

Forum for questions and support relating to the 1.30.x releases only.
Locked
mrgar
Posts: 10
Joined: Mon May 01, 2017 2:41 am

Zoneminder service times out a few minutes after starting

Post by mrgar »

Thanks for helping me get started. I got the web interface up, but zoneminder times out within a few minutes of starting the service.
Here is the report:

Code: Select all

$ systemctl start zoneminder.service
Zoneminder starts up and runs for a few minutes...

Code: Select all

Job for zoneminder.service failed because a timeout was exceeded.
See "systemctl status zoneminder.service" and "journalctl -xe" for details.
Output from systemctl status zoneminder.service

Code: Select all

$ systemctl status zoneminder.service
● zoneminder.service - ZoneMinder CCTV recording and security system
   Loaded: loaded (/usr/lib/systemd/system/zoneminder.service; enabled; vendor p
   Active: failed (Result: timeout) since Mon 2017-05-01 21:30:51 CDT; 2min 51s 
   Process: 24186 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=0/SUCCES

May 01 21:30:40 archer systemd[1]: zoneminder.service: Start operation timed out. Terminating.
May 01 21:30:40 archer zmdc[24199]: INF ['zmfilter.pl' sending stop to pid 24235 at 17/05/01 21:30:40]
May 01 21:30:40 archer zmdc[24199]: INF ['zmfilter.pl' exited, signal 14]
May 01 21:30:40 archer zmdc[24199]: INF ['zmaudit.pl -c' exited, signal 14]
May 01 21:30:40 archer zmdc[24199]: INF ['zmwatch.pl' exited, signal 14]
May 01 21:30:40 archer zmdc[24199]: INF ['zmupdate.pl -c' exited, signal 14]
May 01 21:30:51 archer zmdc[24199]: INF [Server shutdown at 17/05/01 21:30:51]
May 01 21:30:51 archer systemd[1]: Failed to start ZoneMinder CCTV recording and security system.
May 01 21:30:51 archer systemd[1]: zoneminder.service: Unit entered failed state.
May 01 21:30:51 archer systemd[1]: zoneminder.service: Failed with result 'timeout'.
I have the zm-log available if you'd like to see it. It looks like there are lots of permissions that need to be tweaked.
mrgar
Posts: 10
Joined: Mon May 01, 2017 2:41 am

Re: Zoneminder service times out a few minutes after starting

Post by mrgar »

Here are the top lines from the zm log:

Code: Select all

2017-05-02 03:07:32.294890	zmdc		24884	INF	Server shutdown at 17/05/01 22:07:32	zmdc.pl	
2017-05-02 03:07:22.179100	zmdc		24884	INF	'zmupdate.pl -c' exited, signal 14	zmdc.pl	
2017-05-02 03:07:22.153980	zmdc		24884	INF	'zmwatch.pl' exited, signal 14	zmdc.pl	
2017-05-02 03:07:22.128970	zmdc		24884	INF	'zmaudit.pl -c' exited, signal 14	zmdc.pl	
2017-05-02 03:07:22.104020	zmdc		24884	INF	'zmfilter.pl' exited, signal 14	zmdc.pl	
2017-05-02 03:07:22.045890	zmdc		24884	INF	'zmupdate.pl -c' sending stop to pid 24954 at 17/05/01 22:07:22	zmdc.pl	
2017-05-02 03:07:12.303750	zmdc		24884	ERR	'zmtelemetry.pl' exited abnormally, exit status 9	zmdc.pl	
2017-05-02 03:07:12.048200	zmdc		25063	INF	'zmtelemetry.pl' started at 17/05/01 22:07:12	zmdc.pl	
2017-05-02 03:07:12.048190	zmdc		24884	INF	'zmtelemetry.pl' starting at 17/05/01 22:07:12, pid = 25063	zmdc.pl	
2017-05-02 03:07:12.020780	zmdc		24884	INF	Starting pending process, zmtelemetry.pl	zmdc.pl
mrgar
Posts: 10
Joined: Mon May 01, 2017 2:41 am

Re: Zoneminder service times out a few minutes after starting

Post by mrgar »

I made sure http owns temp, sock ...

Now, these are the main errors coming from the zm-log:

Code: Select all

System Log
Updated: Tue 2nd May, 3:38am 	State: alarm 	Total: 1666 	Available: 1666 	Displaying: 200
Date/Time          ComponentServer 	 PID   Level 	Message 				File 	Line
2017-05-02 03:34:58.983205	zms		25791	ERR	Unable to authenticate user	zms.cpp	225

2017-05-02 03:35:10.822299	web_php		23423	ERR	socket_sendto( /var/lib/zoneminder/sock/zms-924381s.sock ) failed: No such file or directory	zoneminder/includes/functions.php	1993
2017-05-02 03:35:10.898944	web_js		23423	ERR	getStreamCmdResponse stream error: socket_sendto( /var/lib/zoneminder/sock/zms-924381s.sock ) failed: No such file or directory - checkStreamForErrors()	?view=watch	
2017-05-02 03:35:22.918061	web_php		20902	ERR	socket_sendto( /var/lib/zoneminder/sock/zms-924381s.sock ) failed: No such file or directory	zoneminder/includes/functions.php	1993
bbunge
Posts: 2979
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder service times out a few minutes after starting

Post by bbunge »

Linux distro and version? Instructions you used to install ZM?
rockedge
Posts: 1199
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Zoneminder service times out a few minutes after starting

Post by rockedge »

mrgar wrote: Mon May 01, 2017 2:55 am I have built ZoneMinder from the Arch Linux AUR. It compiled but I am having difficulty getting the software to start.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder service times out a few minutes after starting

Post by knight-of-ni »

Part of the problem is you are missing dependencies zoneminder needs to run. This is one of the reasons why we discourage from-source builds.

The best way go about installing zoneminder on any system, is to use the packaging scripts someone else already developed, so each new user isn't constantly trying to reinvent the wheel. I know Arch has quite a bit of documentation on ZoneMinder, and I'm sure you could figure out how to build your own Arch zoneminder package based on that information. That would solve all the dependency problems for you.

If you want to do it the hard way, then what you need to do is start calling those failed perl scripts in your logs directly from the command line to see what the failure is. zmtelemerty.pl for certain is going to spit out exactly what perl modules are missing. Next up is zmupdate.pl. Try calling it with and without the "-c" parameter, and so on.....

You've also got an authentication error. Note that, if cmake was not able to find an md5 function on your system, zoneminder will still build but authentication won't work. For a from-soucre build, the only way to find out is to watch the cmake output during the build. The previously mentioned packaged build method would avoid this because it will pull in the right dependencies during the build. If you want to revisit this particular problem later then turn off authentication under options.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
mrgar
Posts: 10
Joined: Mon May 01, 2017 2:41 am

Re: Zoneminder service times out a few minutes after starting

Post by mrgar »

Thanks everyone. I was able to get authentication. You are right about the issues with building this. I am pretty sure the issues reside in http.conf
and the ScriptAlias not allowing cgi. I couldn't find anything in the Arch Wiki that defined the cgi path for Arch. After a ton of trial and error failures, I think I will install ubuntu server on another machine and follow the easy install. I use ubuntu server on my Linode VPS with no issues so this might be the easiest solution. Before I do this, does anyone have suggestions of another lighter distro that has thorough documentation on the install and configuration? Thanks again - the support here is excellent! :P
rockedge
Posts: 1199
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Zoneminder service times out a few minutes after starting

Post by rockedge »

there is a version of Puppy Linux Tahr 6.0.5 which is based on Ubuntu 14.04 binaries which comes with a version of zoneminder 1.30.2 that is running. The ISO file is 581 M. Download burn a CD or install to USB drive or a Virtual machine put it on the HDD.
Here -> https://forums.zoneminder.com/viewtopi ... 223#p99223
Locked