Page 1 of 1

Warning, overriding installed ./zm.conf file with local copy

Posted: Sat Apr 10, 2010 12:10 pm
by buzz_host
I seem to be hitting an error for reasons I don't fully understand. There are a couple of posts here which mention the error, but they have not helped me to clear it up.

I have set up ZM on Debian a few times, and have a working 1.23.3 - so I'm not totally new at this. My issues come from compiling zm from source on Slackware 13.

These are the steps I've taken, and the order.

Code: Select all

./configure --with-webdir=/srv/httpd/htdocs/zm --with-cgidir=/srv/httpd/cgi-bin
[no errors]
make
make install
Next log into mysql as root and create the database thus: (MySQL prompt not shown for clarity of commands)

Code: Select all

create database zm
grant select,insert,update,delete on zm.* to 'z0neUSER'@localhost identified by 'z0nem1nder';
use zm;
source db/zm_create.sql
quit
Edit the /usr/local/etc/zm.conf to suit the different db credentials:

Code: Select all

# ZoneMinder database user
ZM_DB_USER=z0neUSER

# ZoneMinder database password
ZM_DB_PASS=z0nem1nder
Set it so it can be world read (bad, but just in case):

Code: Select all

chmod 644 /usr/local/etc/zm.conf
To allow it to run at boot I copy the 'zm' script and +x it with:

Code: Select all

cp /usr/local/src/ZoneMinder-1.24.2/scripts/zm /etc/rc.d/rc.zm
chmod +x /etc/rc.d/rc.zm
But if I attempt to start it and it bails with:

Code: Select all

/etc/rc.d/rc.zm start
Starting ZoneMinder: Warning, overriding installed ./zm.conf file with local copy
DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/lib/perl5/site_perl/5.10.0/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/lib/perl5/site_perl/5.10.0/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.10.0/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/lib/perl5/site_perl/5.10.0/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.10.0/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.
                                                           [FAILED]
NB 'zmpkg.pl start' does the same but lacks the '[FAILED]' on the end - same result, does not start. I note that these are the wrong (and default) credentials I've just replaced in /usr/local/etc/zm.conf. Checking the file it's not been overwritten at all. It's like it's not reading my zm.conf or can't read it.

To troubleshoot this I add the default MySQL user thus:

Code: Select all

grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
flush privileges;
It does then start, but complains:

Code: Select all

/etc/rc.d/rc.zm start
Starting ZoneMinder: Warning, overriding installed ./zm.conf file with local copy 
[  OK  ]
touch: cannot touch `/var/lock/subsys/zm': No such file or directory
Browsing to http://host/zm fails with the warning:
Could not connect to database: Access denied for user 'zmuser'@'localhost' (using password: YES)
I don't appear to have any issues with the MySQL users as I can log in using zmuser with password zmpass and view all the tables etc:

Code: Select all

mysql -u zmuser -p
Enter password: 
...
mysql> use zm

Database changed
mysql> show tables;
+----------------+
| Tables_in_zm   |
+----------------+
| Config         | 
| ControlPresets | 
| Controls       | 
| Devices        | 
| Events         | 
| Filters        | 
| Frames         | 
| Groups         | 
| MonitorPresets | 
| Monitors       | 
| States         | 
| Stats          | 
| TriggersX10    | 
| Users          | 
| ZonePresets    | 
| Zones          | 
+----------------+
Looking over the docs, the only thing I could have missed is the ./configure options:
ZM_DB_PASS
ZM_DB_USER
But my understanding is these merely produce the template for zm.conf anyway and it should work with 'zmuser/zmpass'???

I've looked at this long and hard, I've got to be missing something really obvious here???? [/code]

Posted: Sun Apr 11, 2010 4:27 am
by kingofkya
i bet you have a second zm.conf under /etc/zm.conf its reading