ZoneMinder failing to start as a service...

Forum for questions and support relating to the 1.25.x releases only.
Locked
grpace
Posts: 4
Joined: Thu Jun 14, 2012 12:30 am

ZoneMinder failing to start as a service...

Post by grpace »

Install appeared successful... I can get to ZoneMinder Control Panel with localhost/zm... However, I get nothing from the cam.

When trying to launch ZoneMinder as a service from the linux terminal, I get:
-----
Starting ZoneMinder: Bareword "ZM_WEB_GROUP" not allowed while "strict subs" in use at /usr/share/perl5/ZoneMinder/Logger.pm line 557.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 34.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 34.
Compilation failed in require at /usr/bin/zmpkg.pl line 37.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 37.
failure
----

Also, after setting up the camera in the Control Panel, then clicking "Probe", I'm getting:
-----
Notice: Use of undefined constant ZM_V4L2 - assumed 'ZM_V4L2' in /usr/share/zoneminder/skins/classic/views/monitorprobe.php on line 30 Unable to probe network cameras, status is '127'
-----

Does anyone have any ideas on how to fix this ???

Thank you in advance.
grpace
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: ZoneMinder failing to start as a service...

Post by PacoLM »

Try to run the service with:

Code: Select all

sudo service zoneminder restart
and let us know if you get the same error.

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
User avatar
AllenTuttle
Posts: 30
Joined: Tue Sep 25, 2007 4:56 pm
Location: Sequim WA.

Re: ZoneMinder failing to start as a service...

Post by AllenTuttle »

Looks like a Perl update is killing ZoneMinder.
----------------------------------------------
Zoneminder 'began' to fail for me after upgrading to Fedora Core 17.
I noticed it was also now displaying GMT instead of local time on my ZoneMinder page.
--
I applied the latest Fedora patches and could no longer start ZoneMinder or log into its web page.
--
There were several Bareword errors:
Bareword "ZM_DIR_EVENTS" not allowed while "strict subs" in use at /usr/local/bin/zmupdate.pl
Bareword "ZM_DYN_DB_VERSION" not allowed while "strict subs" in use at /usr/local/bin/zmupdate.pl
Bareword "ZM_RUN_AUDIT" not allowed while "strict subs" in use at /usr/local/bin/zmpkg.pl
Bareword "ZM_OPT_TRIGGERS" not allowed while "strict subs" in use at /usr/local/bin/zmpkg.pl
Bareword "ZM_OPT_X10" not allowed while "strict subs" in use at /usr/local/bin/zmpkg.pl
Bareword "ZM_CHECK_FOR_UPDATES" not allowed while "strict subs" in use at /usr/local/bin/zmpkg.pl
Bareword "ZM_DYN_DB_VERSION" not allowed while "strict subs" in use at /usr/local/bin/zmpkg.pl
---
I cannot recommend editing all of the ZoneMinder pl and pm files that have 'use strict' in them however....
I commented out most if not all of those and was able to get ZM running, for the moment.
grpace
Posts: 4
Joined: Thu Jun 14, 2012 12:30 am

Re: ZoneMinder failing to start as a service...

Post by grpace »

Thank You, PacoLM and Allen for your replies.
1st, I'm running Ubuntu 12.04 LTS.

To Paco:
I tried your suggestion. Here is what Terminal reported:
-----
Stopping ZoneMinder: Bareword "ZM_WEB_GROUP" not allowed while "strict subs" in use at /usr/share/perl5/ZoneMinder/Logger.pm line 557.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 34.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 34.
Compilation failed in require at /usr/bin/zmpkg.pl line 37.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 37.
Zoneminder already stopped

Starting ZoneMinder: Bareword "ZM_WEB_GROUP" not allowed while "strict subs" in use at /usr/share/perl5/ZoneMinder/Logger.pm line 557.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 34.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 34.
Compilation failed in require at /usr/bin/zmpkg.pl line 37.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 37.
failure
-----

To Allen:
Fortunately, I do not have as many errors as you did! However, I wonder what effect commenting-out those lines causing the errors will have in the long run.

By the way... For All...
After a re-boot, cheese, guvcview and Skype see the camera as normal.

I am concerned about one thing I've read on forums...
The part about doing a hard link from apache2.conf to ZoneMinder's .conf file...

I don't want ZoneMinder completely taking over the server. Instead, I would just like to invoke it and use it when I'm not home. I edited the apache2.conf file and Included ZoneMinder's .conf file in it, which allowed me to get to ZoneMinder's Control Panel using localhost/zm.

But the question still remains...
What does the status code 127 mean when trying to Probe the camera ??

Again,
Thank all of you for your help on this.

grpace
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: ZoneMinder failing to start as a service...

Post by PacoLM »

Have you install from scratch or made an upgrade?. I'm not sure 100% but I recall read posts from users complaining about errors like those due to a politician, sorry, corrupted database. Have you tried to use phpmyadmin to check the ZM database?

PacoLM

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
grpace
Posts: 4
Joined: Thu Jun 14, 2012 12:30 am

Re: ZoneMinder failing to start as a service...

Post by grpace »

Thank you, PacoLM...

I installed ZoneMinder from scratch... First time I've tried the package. phpmyadmin shows the zm database, and it doesn't appear to be corrupted.

grpace
grpace
Posts: 4
Joined: Thu Jun 14, 2012 12:30 am

Re: ZoneMinder failing to start as a service...

Post by grpace »

OK... For all reading this...
I got ZoneMinder running as a service, now. The "startup errors" appear to have been my own fault.

I read somewhere in a post that many times the system will load /dev/video0 as the root user. So, in an effort to get the cam working with ZoneMinder, I thought I would setup ZoneMinder's user name as "root". In the file /etc/zm/zm.conf:

Code: Select all

# Username and group that web daemon (httpd/apache) runs as
ZM_WEB_USER=www-data
ZM_WEB_GROUP=www-data
#ZM_WEB_USER=root
#ZM_WEB_GROUP=root
I had commented-out the www-data lines, added the following two lines (now commented-out), and invariably had left the 2nd ZM_WEB_GROUP commented-out. That's why the ZM_WEB_GROUP error was occurring.

Next, when I took a closer look at the symbollic link to what I *thought* was Apache's config:

Code: Select all

sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
I realized this was only linking two of ZoneMinder's config files together.. So, I did the link.

Next, in another post I read that the user "www-data" has to be added to the video:

Code: Select all

sudo adduser www-data video
ZoneMinder now boots as a service with no errors, and ZM's Console allows me to stop/start the service. Now, I just need to know how to remove the service from boot start-up and use the Control Panel to start/stop ZM.

However, this has still not allowed ZM to actually see the camera.
ZM log shows these errors:

Code: Select all

zmdc	5818	ERR	'zmc -d /dev/video0' exited abnormally, exit status 255	zmdc.pl
zmc_dvideo0	6026	FAT	Failed to get picture attributes: Invalid argument	zm_local_camera.cpp	540
In the configuration for the Monitor/Camera, I have:

General Tab:
Source Type: Local
Function: Monitor
Enabled is checked

Source Tab:
Device Path: /dev/video0
Capture Method: Video for Linux 1 (changing to V4L2 makes no difference)
Device Channel: 0
Device Format: NTSC
Capture Pallette: RGB24
Capture Width/Height: 320x180

Now, what is interesting, even specifying V4L1, when Probing the camera, I still get the error:

Code: Select all

Notice: Use of undefined constant ZM_V4L2 - assumed 'ZM_V4L2' in /usr/share/zoneminder/skins/classic/views/monitorprobe.php on line 30 Unable to probe network cameras, status is '127'
We're getting closer, but still no cigar. I'm wondering if the device channel is what's causing it to fail. I'm rather new to linux, so I don't understand a lot. It is a USB webcam, connected to a 4-port hub. In Terminal, lsusb shows:

Code: Select all

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 1058:1100 Western Digital Technologies, Inc. 
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 002 Device 002: ID 04f9:01ab Brother Industries, Ltd MFC-240C
Bus 001 Device 005: ID 154b:6545 PNY FD Device
Bus 001 Device 006: ID 046d:081d Logitech, Inc. HD Webcam C510
Any ideas ??
Thank You !!
Locked