Page 1 of 1

Not able to start start zmpkg.pl service in zoneminder

Posted: Sun Jan 17, 2010 9:26 am
by jmcbabu
Hi Dears,

I need your valuable help to fix my installation issue of ZoneMinder-1.24.2 version on RHEL 5.0. My problem is given as below.

I am using ZoneMinder-1.24.2 version on RHEL 5.0 and i did the following step to complete the installation.

1. ./configure --with-mysql=/usr/ --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin ZM_SSL_LIB=openssl

Result is : SUCCESS

2. #mysql -p
Password: * * * *
> create database zm;

Result is: SUCCESS
3. Then i created mysql dump using below command query.
#mysqldump -uroot -p zm > /root/ZoneMinder-1.24.2/db/ZMDB.sql

Result : SUCCESS

4. Then i created user name called 'zmuser' in database as below

> CREATE USER 'zmuser'@'localhost' IDENTIFIED BY 'zmnewpass';

Result: SUCCESS

5.Then i provided full permission for user "zmuser" on database "zm" as below

>GRANT ALL PRIVILEGES ON `zm\_%` . * TO 'zmuser'@localhost identified by 'zmnewpass';

Result : SUCCESS

6.Restart MYSQLADMIN service as below

#mysqladmin -uroot -p reload

RESULT : SUCCESS

7. I used 'make' as root user

# /root/ZoneMinder-1.24.2/make

Result : SUCCESS

8. I used 'make install' as root user

# /root/ZoneMinder-1.24.2/make install

Result : SUCCESS

[b]9. But when i try to issue /usr/local/bin/zmpkg.pl start command in root prompt i am getting below error

#/usr/local/bin/zmpkg.pl start

Error: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder.pm line 33.
Compilation failed in require at /usr/local/bin/zmpkg.pl line 46.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 46.
[/b]

Posted: Wed Jan 20, 2010 8:20 am
by nugget
I have just started a new Zoneminder installation, and I get the same error.

My guess is the database user account (created with the mysql grant select,insert,update,delete on zm.* to 'zmuser' ...) and the entry for user/pass in /etc/zm.conf.

Did you use any special characters in the password ($#@!, etc)? can you login from the shell prompt to the database:
$ mysql -uzmuser -p<password> zm

If the last command works (and the username/password are the same as /etc/zm.conf) then I have no idea. Which is my problem...

I found a note on the Mysql forums suggesting if you have a firewall blocking port 3306/tcp then you would recieve this message. The only thing I can add to this is do you have an entry for 'localhost' in /etc/hosts (127.0.0.1), and is the loopback interface configured and up?

I still have the problem, but will keep digging...

Eureka!

Posted: Wed Jan 20, 2010 8:36 am
by nugget
Passwords...

The ZM startup script (/etc/init.d/zm) grabs username/passwords out of zm.conf, and passes them to the PERL code to start the daemons & login to the database.

My problem was I had a copy of /etc/zm.conf from an aborted attempt at install previously. The username/password were correct in here.

There was also a copy in /usr/local/etc/zm.conf with the default user/pass (zmuser/zmpass) which was incorrect. I corrected the /usr/local copy, and the daemons now start.