0.9.15 zmpkg: Bareword found in conditional?

Support and queries relating to all previous versions of ZoneMinder
Locked
jean
Posts: 13
Joined: Wed Oct 29, 2003 4:49 am

0.9.15 zmpkg: Bareword found in conditional?

Post by jean »

Greetings,

I have installed and configured zoneminder 0.9.15 on my Gentoo box per the instructions in the readme. I chose to do so by hand after struggling with (and getting fed up with) the 0.9.12 ebuild.

In both cases (with the ebuild 0.9.12 and the manually installed 0.9.15) I am getting complaints about 'Bareword's in zmpkg.pl:

[snip]
Starting ZoneMinder: Bareword "ZM_PATH_LOGS" not allowed while "strict subs" in use at /usr/local/bin/zmpkg.pl line 62.
BEGIN not safe after errors--compilation aborted at /usr/local/bin/zmpkg.pl line 63.
failure
[/snip]

I started trying to fix this by hand (by replacing the variables with hard coded paths, etc.), but the problem appears to be far deeper than just one or two undefined variables, and I am not familiar enough with perl to fix it myself.

I am running perl 5.8, on an up-to-date Gentoo 1.4 box:

* dev-lang/perl
Latest version available: 5.8.0-r12
Latest version installed: 5.8.0-r12
Size of downloaded files: 10,854 kB
Homepage: http://www.perl.org/
Description: Larry Wall's Practical Extraction and Reporting Language

Does anyone have any idea what would cause this error, and how to go about fixing it. I tried removing the 'use strict;' clause, but that only delays the error until line 187:

[snip]
Starting ZoneMinder: Bareword found in conditional at /usr/local/bin/zmpkg.pl line 187.
Bareword found in conditional at /usr/local/bin/zmpkg.pl line 198.
Bareword found in conditional at /usr/local/bin/zmpkg.pl line 202.
Can't open log file: No such file or directory at /usr/local/bin/zmpkg.pl line 123.
failure
[/snip]

Any insight or suggestions would be greatly appreciated!
jean
Posts: 13
Joined: Wed Oct 29, 2003 4:49 am

Re: 0.9.15 zmpkg: Bareword found in conditional?

Post by jean »

OK, I managed to get over this hump by (re-?)running 'perl zmconfig.pl -noi'. However, when I try to start zoneminder from the web gui (or from the command line using '/usr/local/bin/zmpkg.pl start') zm fails to start. Looking at the logs I find the following messages:

Executing: /usr/local/bin/zmdc.pl check
Removing shared memory
Executing: /usr/local/bin/zmfix
Executing: /usr/local/bin/zmdc.pl status
Can't open log file: Permission denied at /usr/local/bin/zmdc.pl line 153.
Can't connect: No such file or directory at /usr/local/bin/zmdc.pl line 145.
Executing: /usr/local/bin/zmdc.pl start zmc -d 0
Can't open log file: Permission denied at /usr/local/bin/zmdc.pl line 153.
Can't connect: No such file or directory at /usr/local/bin/zmdc.pl line 145.
Executing: /usr/local/bin/zmdc.pl start zmaudit.pl -d 900 -y
Can't open log file: Permission denied at /usr/local/bin/zmdc.pl line 153.
Can't connect: No such file or directory at /usr/local/bin/zmdc.pl line 145.
Executing: /usr/local/bin/zmdc.pl start zmwatch.pl
Can't open log file: Permission denied at /usr/local/bin/zmdc.pl line 153.
Can't connect: No such file or directory at /usr/local/bin/zmdc.pl line 145.

Looking at the perl script, it appears to be failing at the following line:

open( LOG, ">>".DC_LOG_FILE ) or die( "Can't open log file: $!" );

My question is (other than the obvious: 'how do I fix this?'), what is DC_LOG_FILE, where is it defined, and if it isn't present, what should it be defined as?

Many thanks in advance,

Jean.
jean
Posts: 13
Joined: Wed Oct 29, 2003 4:49 am

Re: 0.9.15 zmpkg: Bareword found in conditional?

Post by jean »

OK, now to the third hurdle (I suspect I'm having a conversation of one, and that I am merely documenting the gotchas in trying to get zoneminder installed on a Gentoo system, but oh well).

I discovered that I needed to change ownership of the log directory (/var/log/zoneminder on my machine) to that of apache. Now I get the following error:

Starting pending process, zmc -d 0
'zmc -d 0' started at 03/10/30 16:32:16
'zmc -d 0' starting at 03/10/30 16:32:16, pid = 24140
'zmc -d 0' crashed at 03/10/30 16:32:16, exit status 255

for my passive monitor, which is trying to read channel 4 off of my bttv card (the building lobby monitor via our cable system). I really do not understand this, as I've bumped my shared memory up to 512 MB (0x20000000), and according to ipcs shared memory is being allocated:

yatima zoneminder # !ipcs
ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 65536 jean 777 393216 2 dest
0x00000000 1048577 jean 777 393216 2 dest
0x00000000 1179650 jean 777 49920 2 dest
0x7a6d2002 1015811 apache 700 19200448 0

Anyone with any suggestions on how to proceed? I'll keep chipping away at this, but so far no luck.

tia,

Jean.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: 0.9.15 zmpkg: Bareword found in conditional?

Post by zoneminder »

Hi Jean-Michel,

Sorry for being a bit late on this, and congrats for figuring out what you have so far.

The error you are seeing in your zmc is usually a case of it failing to set up the video attributes. You can check this by looking for messages with an ERR in in /var/log/messages (or whatever file your syslog is configured to write errors to, normally in /var/log/). If this is the case often this can eb fixed by turning STRICT_VIDEO_CONFIG to off in the options.

What you say you are trying to get it to read channel 4 do you mean as in /dev/video3 (the 4th device) or a 4th channel of /dev/video0 for example?

Phil,
jean
Posts: 13
Joined: Wed Oct 29, 2003 4:49 am

Re: 0.9.15 zmpkg: Bareword found in conditional?

Post by jean »

Hi Philip,

Re your question: What you say you are trying to get it to read channel 4 do you mean as in /dev/video3 (the 4th device) or a 4th channel of /dev/video0 for example?

I am trying to read channel four (4) off of the first device (/dev/video0). I have device set to 0 and channel set to 4. I'm at work, but I'll look for the ERR messages tonight. As a Gentoo user I am running metalog, so there isn't a /var/log/messages ... however, there is a /var/log/everything/current which should be roughly equivelent. I am assuming metalog is compatible with other loggers as far as third party apps are concerned.

I'll post a followup once I've had a chance to look it over, and I'll try setting STRICT_VIDEO_CONFIG to 0.

thanks!

Jean.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: 0.9.15 zmpkg: Bareword found in conditional?

Post by zoneminder »

Hi Jean,

It _may_ be different on your system but on mine the fourth channel is actually numbered 3, ie it starts from zero. Of course if you're trying to read the fifth channel then 4 may well be right.

Just in case it's something as simple as that!

Phil,
jean
Posts: 13
Joined: Wed Oct 29, 2003 4:49 am

Re: 0.9.15 zmpkg: Bareword found in conditional?

Post by jean »

Hi Philip,

You were correct, I need to be putting channel 3 (fourth channel) in ... I think. In any event, it didn't have any effect on my problem. zmc is still dying, and /var/log/everything/current (gentoo/metalog equivelent of /var/log/messages) reports:

ct 31 17:34:57 [zmfix] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:34:57 [zmfix] INF [Resetting permissions on /dev/video0 to 20666]
Oct 31 17:35:00 [zmc-d0] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:00 [zmc-d0] INF [Got 1 monitors]
Oct 31 17:35:01 [zmc-d0] INF [X:0]
Oct 31 17:35:01 [zmc-d0] INF [Y:0]
Oct 31 17:35:01 [zmc-d0] INF [W:320]
Oct 31 17:35:01 [zmc-d0] INF [H:240]
Oct 31 17:35:01 [zmc-d0] INF [P:4]
Oct 31 17:35:01 [zmc-d0] INF [D:0]
Oct 31 17:35:01 [zmc-d0] INF [B:32768]
Oct 31 17:35:01 [zmc-d0] INF [h:32768]
Oct 31 17:35:01 [zmc-d0] INF [Cl:32512]
Oct 31 17:35:01 [zmc-d0] INF [Cn:27648]
Oct 31 17:35:01 [zmc-d0] INF [vmb.frames = 4]
Oct 31 17:35:01 [zmc-d0] INF [vmb.size = 8519680]
Oct 31 17:35:01 [zmc-d0] ERR [Failed to get camera source: Invalid argument]
Oct 31 17:35:01 [zmc-d0] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:01 [zmc-d0] INF [Got 1 monitors]
Oct 31 17:35:01 [zmc-d0] INF [X:0]
Oct 31 17:35:01 [zmc-d0] INF [Y:0]
Oct 31 17:35:01 [zmc-d0] INF [W:320]
Oct 31 17:35:01 [zmc-d0] INF [H:200]
Oct 31 17:35:01 [zmc-d0] INF [P:1]
Oct 31 17:35:01 [zmc-d0] INF [D:8]
Oct 31 17:35:01 [zmc-d0] INF [B:32768]
Oct 31 17:35:01 [zmc-d0] INF [h:32768]
Oct 31 17:35:01 [zmc-d0] INF [Cl:32512]
Oct 31 17:35:01 [zmc-d0] INF [Cn:27648]
Oct 31 17:35:01 [zmc-d0] INF [vmb.frames = 4]
Oct 31 17:35:01 [zmc-d0] INF [vmb.size = 8519680]
Oct 31 17:35:01 [zmc-d0] ERR [Failed to get camera source: Invalid argument]
Oct 31 17:35:06 [zmc-d0] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:06 [zmc-d0] INF [Got 1 monitors]
Oct 31 17:35:06 [zmc-d0] INF [X:0]
Oct 31 17:35:06 [zmc-d0] INF [Y:0]
Oct 31 17:35:06 [zmc-d0] INF [W:320]
Oct 31 17:35:06 [zmc-d0] INF [H:200]
Oct 31 17:35:06 [zmc-d0] INF [P:1]
Oct 31 17:35:06 [zmc-d0] INF [D:8]
Oct 31 17:35:06 [zmc-d0] INF [B:32768]
Oct 31 17:35:06 [zmc-d0] INF [h:32768]
Oct 31 17:35:06 [zmc-d0] INF [Cl:32512]
Oct 31 17:35:06 [zmc-d0] INF [Cn:27648]
Oct 31 17:35:06 [zmc-d0] INF [vmb.frames = 4]
Oct 31 17:35:06 [zmc-d0] INF [vmb.size = 8519680]
Oct 31 17:35:06 [zmc-d0] ERR [Failed to get camera source: Invalid argument]
Oct 31 17:35:10 [zmu] ERR [Shared memory not initialised by capture daemon]
Oct 31 17:35:10 [zms] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:10 [zms] INF [Got 1 monitors]
Oct 31 17:35:10 [zms] INF [monitor mode=0]
Oct 31 17:35:10 [zms] INF [shm.size=6400448]
Oct 31 17:35:10 [zms] ERR [Shared memory not initialised by capture daemon]
Oct 31 17:35:16 [zmc-d0] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:16 [zmc-d0] INF [Got 1 monitors]
Oct 31 17:35:16 [zmc-d0] INF [X:0]
Oct 31 17:35:16 [zmc-d0] INF [Y:0]
Oct 31 17:35:16 [zmc-d0] INF [W:320]
Oct 31 17:35:16 [zmc-d0] INF [H:200]
Oct 31 17:35:16 [zmc-d0] INF [P:1]
Oct 31 17:35:16 [zmc-d0] INF [D:8]
Oct 31 17:35:16 [zmc-d0] INF [B:32768]
Oct 31 17:35:16 [zmc-d0] INF [h:32768]
Oct 31 17:35:16 [zmc-d0] INF [Cl:32512]
Oct 31 17:35:16 [zmc-d0] INF [Cn:27648]
Oct 31 17:35:16 [zmc-d0] INF [vmb.frames = 4]
Oct 31 17:35:16 [zmc-d0] INF [vmb.size = 8519680]
Oct 31 17:35:16 [zmc-d0] ERR [Failed to get camera source: Invalid argument]
Oct 31 17:35:36 [zmc-d0] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:36 [zmc-d0] INF [Got 1 monitors]
Oct 31 17:35:36 [zmc-d0] INF [X:0]
Oct 31 17:35:36 [zmc-d0] INF [Y:0]
Oct 31 17:35:36 [zmc-d0] INF [W:320]
Oct 31 17:35:36 [zmc-d0] INF [H:200]
Oct 31 17:35:36 [zmc-d0] INF [P:1]
Oct 31 17:35:36 [zmc-d0] INF [D:8]
Oct 31 17:35:36 [zmc-d0] INF [B:32768]
Oct 31 17:35:36 [zmc-d0] INF [h:32768]
Oct 31 17:35:36 [zmc-d0] INF [Cl:32512]
Oct 31 17:35:36 [zmc-d0] INF [Cn:27648]
Oct 31 17:35:36 [zmc-d0] INF [vmb.frames = 4]
Oct 31 17:35:36 [zmc-d0] INF [vmb.size = 8519680]
Oct 31 17:35:36 [zmc-d0] ERR [Failed to get camera source: Invalid argument]
Oct 31 17:35:37 [zmfix] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:37 [zmfix] INF [Permissions on /dev/video0 are ok at 20666]
Oct 31 17:35:37 [zmc-d0] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:37 [zmc-d0] INF [Got 1 monitors]
Oct 31 17:35:37 [zmc-d0] INF [X:0]
Oct 31 17:35:37 [zmc-d0] INF [Y:0]
Oct 31 17:35:37 [zmc-d0] INF [W:320]
Oct 31 17:35:37 [zmc-d0] INF [H:200]
Oct 31 17:35:37 [zmc-d0] INF [P:1]
Oct 31 17:35:37 [zmc-d0] INF [D:8]
Oct 31 17:35:37 [zmc-d0] INF [B:32768]
Oct 31 17:35:37 [zmc-d0] INF [h:32768]
Oct 31 17:35:37 [zmc-d0] INF [Cl:32512]
Oct 31 17:35:37 [zmc-d0] INF [Cn:27648]
Oct 31 17:35:37 [zmc-d0] INF [vmb.frames = 4]
Oct 31 17:35:37 [zmc-d0] INF [vmb.size = 8519680]
Oct 31 17:35:37 [zmc-d0] INF [C:3]
Oct 31 17:35:37 [zmc-d0] INF [F:0]
Oct 31 17:35:37 [zmc-d0] INF [Fl:2]
Oct 31 17:35:37 [zmc-d0] INF [T:2]
Oct 31 17:35:37 [zmc-d0] INF [X:0]
Oct 31 17:35:37 [kernel] bttv0: PLL can sleep, using XTAL (28636363).
Oct 31 17:35:37 [zmc-d0] INF [Y:0]
Oct 31 17:35:37 [zmc-d0] INF [W:320]
Oct 31 17:35:37 [zmc-d0] INF [H:200]
Oct 31 17:35:37 [zmc-d0] INF [P:1]
Oct 31 17:35:37 [zmc-d0] INF [D:8]
Oct 31 17:35:37 [zmc-d0] INF [B:32768]
Oct 31 17:35:37 [zmc-d0] INF [h:32768]
Oct 31 17:35:37 [zmc-d0] INF [Cl:32512]
Oct 31 17:35:37 [zmc-d0] INF [Cn:27648]
Oct 31 17:35:37 [zmc-d0] INF [monitor mode=1]
Oct 31 17:35:37 [zmc-d0] INF [shm.size=6400448]
Oct 31 17:35:37 [zmc-d0] INF [Initialised zone 0/All - 1 - 320x200 - Rgb:ff0000, AT:15, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0]
Oct 31 17:35:37 [zmc-d0] INF [Monitor Lobby has function 2]
Oct 31 17:35:37 [zmc-d0] INF [Monitor Lobby LBF = '%%s - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
Oct 31 17:35:37 [zmc-d0] INF [Monitor Lobby IBC = 100, WUC = 25, pEC = 10, PEC = 10, FRI = 1000, RBP = 10]
Oct 31 17:35:37 [zmc-d0] INF [Got 1 zones for monitor Lobby]
Oct 31 17:35:37 [zmc-d0] INF [Initialised zone 2/All - 1 - 320x200 - Rgb:ff0000, AT:25, MnAP:1920, MxAP:48000, FB:3x3, MnFP:1920, MxFP:48000, MnBS:1280, MxBS:0, MnB:1, MxB:0]
Oct 31 17:35:37 [zmc-d0] INF [Loaded monitor 2(Lobby), 1 zones]
Oct 31 17:35:37 [zmc-d0] INF [Starting Capture]
Oct 31 17:35:40 [zms] INF [Debug Level = 0, Debug Log = ]
Oct 31 17:35:40 [zms] INF [Got 1 monitors]
Oct 31 17:35:40 [zms] INF [monitor mode=0]
Oct 31 17:35:40 [zms] INF [shm.size=6400448]
Oct 31 17:35:40 [zms] INF [Initialised zone 0/All - 1 - 320x200 - Rgb:ff0000, AT:15, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0]
Oct 31 17:35:40 [zms] INF [Monitor Lobby has function 2]
Oct 31 17:35:40 [zms] INF [Monitor Lobby LBF = '%%s - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
Oct 31 17:35:40 [zms] INF [Monitor Lobby IBC = 100, WUC = 25, pEC = 10, PEC = 10, FRI = 1000, RBP = 10]
Oct 31 17:35:40 [zms] INF [Loaded monitor 2(Lobby), 0 zones]
Oct 31 17:35:47 [zmc-d0] INF [Got TERM signal, exiting]
Oct 31 17:35:47 [zmc-d0] ERR [Sync failure for frame 3: Interrupted system call]

I am confused, as I can bring the video signal up with tvtime or xawtv without any problem. Any suggestions?

thanks again for your help!

Jean.
jean
Posts: 13
Joined: Wed Oct 29, 2003 4:49 am

Zomeminder Installed and Working!

Post by jean »

Thank you Philip for the help!

I now have zoneminder installed and working. The final hurdle was actually a misunderstanding on what the term "channel" meant in context with a Hauppauge btv card. It does not refer to the broadcast channel (as I initially thought, i.e. 'channel 96' or 'channel 4' in the traditional TV sense), but rather which of the 4 inputs (svideo-in, antenna-in, etc.). After using tvtime to set the broadcast channel to 4, and selecting channel 0 (antenna-in), it worked perfectly. A little work setting up the zones, and I am monitoring my lobby successfully.

Now I just need to figure out how one automates the archiving of events into a format suitable for burning to CD/DVD for later review, and I'm all set. The information needs to cover a period of weeks or months, and be stored for even longer than that. Any pointers to good howtos on that, or quick tricks that might not be obvious to a newbie like that, would be greatly appreciated.

To recap, I have zomeninder working with...

Gentoo 1.4
Apache 2.0.47-r1
Mysql 4.0.14-r2
kernel 2.6.0-test9-mm1

on a dual athlon 2800+ with 2GB RAM, a Hauppauge Brooktree Bt878 card, accepting input via the antenna interface (on broadcast channel 4) fed via a coax cable from my cable box, which in turn is tuned to the (scrambled) channel that provides our lobby video feed.

This is a very, very cool program!!! My highest regards to the author(s) for an exceptional piece of software ... once the installation is polished for Gentoo (the ebuild needs some work IMHO. Although it is a good start -- my compliments to the ebuild creator as well -- it doesn't do 100% of the job, and the installation process is sufficiently complex that doing 50% of the work is more confusing than simply doing a manual install and following the README step-by-step, which is what I ended up doing).

Thanks again for a most excellent program, and all the help getting it running!

Jean.
Locked