Couple of startup problems

Support and queries relating to all previous versions of ZoneMinder
rug
Posts: 9
Joined: Mon Jan 31, 2005 6:16 pm

Couple of startup problems

Post by rug »

Trying to use 1.20.0

Everything seemed to compile, install and go fine. I am having 2 problems and I don't know if they're related.

I chose during the installation to not use authentication, yet when I go to the ZoneMinder page, I get prompted. I try admin/admin and I just get the same prompt over and over. I tried no password as well. I have seen some mention of this problem here, not sure if it's the same thing.

Secondly, I don't know if it's related, but I when I tried to start the zm service, I got some errors (to be included below). I wasn't sure if I needed to go to the web page to configure some stuff the rest of the way before the service would start, or if I need the service to start in order to to login.

RedHat V9

Code: Select all

Name: ZM_OPT_USE_AUTH
Value: no
Description: Authenticate user logins to ZoneMinder

Name: ZM_AUTH_METHOD
Value: hashed
Description: Method used to send authentication information

Name: ZM_AUTH_SECRET
Value: what3ver22yki
Description: Secret used when encoding authentication information
Here's the errors I got when I tried to start the service...

Code: Select all

service zm start
Starting ZoneMinder: Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 52, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 52, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 52, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 52, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Undefined subroutine &main::ZM_DB_NAME called at /usr/local/bin/zmpkg.pl line 64.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 74.
                                                           [FAILED]
Thanks!
oskin
Posts: 84
Joined: Tue May 25, 2004 7:03 pm
Location: Moscow, Russia

Post by oskin »

Check your installed file zm.conf.
See section 8.1 of README for more info.
rug
Posts: 9
Joined: Mon Jan 31, 2005 6:16 pm

Post by rug »

oskin wrote:Check your installed file zm.conf.
See section 8.1 of README for more info.
Here's the contents:

Code: Select all

# ZoneMinder config
ZM_DB_SERVER=localhost
ZM_DB_NAME=zm
ZM_DB_USER=zm
ZM_DB_PASS=SumPassword
I verified that I can logon to that db through MySQL as that user as well.
oskin
Posts: 84
Joined: Tue May 25, 2004 7:03 pm
Location: Moscow, Russia

Post by oskin »

Apply this patch and show me result:

Code: Select all

--- zmpkg.pl.orig       2005-02-01 23:20:00.237731021 +0300
+++ zmpkg.pl    2005-02-01 23:24:41.885247769 +0300
@@ -48,7 +48,9 @@
        {
                next if ( $str =~ /^\s*$/ );
                next if ( $str =~ /^\s*#/ );
+               print STDERR "[".$str."]\n";
                my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/;
+               print STDERR "[".$name."] [".$value."]\n";
                $name =~ tr/a-z/A-Z/;
                if (( $name eq 'ZM_DB_SERVER' ) ||
                        ( $name eq 'ZM_DB_NAME' ) ||
Warning! If you use copy&paste for obtaining this patch replace leading blanks with appropriate quantity of Tab characters.
rug
Posts: 9
Joined: Mon Jan 31, 2005 6:16 pm

Post by rug »

Ok...

Code: Select all

patch /usr/local/bin/zmpkg.pl ./zmpkg.pl.patch
patching file /usr/local/bin/zmpkg.pl
Hunk #1 succeeded at 48 with fuzz 1.
I should probably add that I didn't notice any difference, but I didn't know if I should do something else first.
oskin
Posts: 84
Joined: Tue May 25, 2004 7:03 pm
Location: Moscow, Russia

Post by oskin »

Ok. Run "service zm start" and show mesages to me
rug
Posts: 9
Joined: Mon Jan 31, 2005 6:16 pm

Post by rug »

Ok, it's a bit different than the previous error...

Code: Select all

service zm start
Starting ZoneMinder: [ZM_DB_SERVER=localhost
]
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
[] []
Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 54, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
[ZM_DB_NAME=zm
]
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
[] []
Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 54, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
[ZM_DB_USER=zm
]
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
[] []
Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 54, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
[ZM_DB_PASS=DOH
]
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 53, <CONFIG> line 5.
[] []
Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 54, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 55, <CONFIG> line 5.
Undefined subroutine &main::ZM_DB_NAME called at /usr/local/bin/zmpkg.pl line 66.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 76.

Last edited by rug on Wed Feb 02, 2005 3:11 pm, edited 1 time in total.
oskin
Posts: 84
Joined: Tue May 25, 2004 7:03 pm
Location: Moscow, Russia

Post by oskin »

Hmm..
Run "head -n 3 zm.conf | od -c" and show me result.

P.S. Change password ZM_DB_PASS and more it do not show here. :)
rug
Posts: 9
Joined: Mon Jan 31, 2005 6:16 pm

Post by rug »

Changed the pw! :oops:

Here's the result:

head -n 3 zm.conf | od -c
0000000 # Z o n e M i n d e r c o n
0000020 f i g \n Z M _ D B _ S E R V E R
0000040 = l o c a l h o s t \n Z M _ D B
0000060 _ N A M E = z m \n
0000071
oskin
Posts: 84
Joined: Tue May 25, 2004 7:03 pm
Location: Moscow, Russia

Post by oskin »

Strange, regular expressions in perl work on miscellaneous on your and my OS...
Try to replace in all scripts (*.pl) string

Code: Select all

my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/;
with string

Code: Select all

my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*\n*$/;
It is added "\n*" at the end of regular expression.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

It's a minor thing but I don't think you need the third check for '='. So instead of

Code: Select all

my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/;
you could use

Code: Select all

my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.+)\s*$/;
as the first version prevents an '=' being in any of the fields when it may well legally be included in a password.

Phil
rug
Posts: 9
Joined: Mon Jan 31, 2005 6:16 pm

Post by rug »

Well, I'm not sure those additions changed anything...

All my .pl files are like this one:

Code: Select all

	no strict 'refs';

	open( CONFIG, "<".ZM_CONFIG ) or die( "Can't open config file: $!" );
	foreach my $str ( <CONFIG> )
	{
		next if ( $str =~ /^\s*$/ );
		next if ( $str =~ /^\s*#/ );
		print STDERR "[".$str."]\n";
		# my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/;
		my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*\n*$/;
		print STDERR "[".$name."] [".$value."]\n";
And it look like I get the same result when I start the service, I'm just giving the first few lines as I'm guessing there's already a problem and I can always put the rest there if you think it's necessary.

Code: Select all

service zm start
Starting ZoneMinder: [ZM_DB_SERVER=localhost
]
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 57, <CONFIG> line 5.
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/zmpkg.pl line 57, <CONFIG> line 5.
[] []
Use of uninitialized value in transliteration (tr///) at /usr/local/bin/zmpkg.pl line 58, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 59, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 59, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 59, <CONFIG> line 5.
Use of uninitialized value in string eq at /usr/local/bin/zmpkg.pl line 59, <CONFIG> line 5.
[ZM_DB_NAME=zm
]
BTW, thank you very much for trying to help me get this going! Am I a unique problem? I didn't see a bunch of other posts with these problems.
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Post by unclerichy »

The problem's not unique - I had it too but manually altered the source files. Funnily enough I'm using Redhat 9 too.
rug
Posts: 9
Joined: Mon Jan 31, 2005 6:16 pm

Post by rug »

Can I just easily edit those .pl files and hard code the db info, or does the problem run more deeply than that?

Did I pick the wrong version of ZoneMinder to start on? :D
oskin
Posts: 84
Joined: Tue May 25, 2004 7:03 pm
Location: Moscow, Russia

Post by oskin »

I too could receive this error on RedHat-9 and perl-5.8.0. On FC3 and perl-5.8.5 works correctly.

Line

Code: Select all

my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/;
is necessary to replace a line

Code: Select all

my ( $name, $value ) = $str =~ /^\s*([^=\\s]+)\s*=\s*(\S+)\s*$/;
Essence in replacement "[^=\s]" on "[^=\\s]".

To Phil: Your remark too is used. :)
Locked