Upgrades and the zm.conf file

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
ttsoares
Posts: 31
Joined: Sat Dec 10, 2005 11:06 pm
Contact:

Upgrades and the zm.conf file

Post by ttsoares »

Greetings all...

This would be a suggestion and an alert to newbies, like myself:

By following the README.txt upgrading from 1.22.1 to 1.22.3 i found a problem with the zmupdate.pl script.

After the "make install" a new /usr/local/etc/zm.conf is created and this do not respect my old one that has a different
ZM_DB_USER and ZM_DB_PASS than the default:

ZM_DB_USER=zmuser
ZM_DB_PASS=zmpass

This is because the zm.conf that is in the ZM source tree has a zm.conf with those defaults...

The catch is that even by doing this:

./scripts/zmupdate.pl -version=1.22.1 --user=xxxxxx --pass=yyyyyy

this info about user and pass is not being inserted in the new /usr/local/etc/zm.conf and by doing so, the upgrade process perl script fails to access the SQL database.

My suggestion is that the zmupdate.pl do not alter an existing /usr/local/etc/zm.conf if such is already existent.
The fact is a secondary aspect of Reality.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

zmupdate does not alter or move zm.conf.
The user and password can be set before compilation in the ./configure line and make install will replace your zm.conf.
User avatar
ttsoares
Posts: 31
Joined: Sat Dec 10, 2005 11:06 pm
Contact:

Maybe i am doing something wrong...

Post by ttsoares »

From my experience, each time one do a "make install" the zm.conf in use is replaced by a new one and the user/pass settings to access the database are changed to the default.

I am following step-by-step the README procedures...
The fact is a secondary aspect of Reality.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

You might want to reread the README as there are options that can be passed via the ./configure script that includes a method to pass your user information. or you can run:
./configure -help
for more details.
User avatar
ttsoares
Posts: 31
Joined: Sat Dec 10, 2005 11:06 pm
Contact:

Post by ttsoares »

The command i use is:

./configure --with-webuser=apache --with-webgroup=apache \ --with-webdir=/var/www/htdocs --with-cgidir=/var/www/cgi-bin

and the result is that i told before...

Do you mean that, for instance, one _must_ do this first?

export ZM_DB_USER=apache
export ZM_DB_PASS=sql_pass

before start the "./configure " command ??
The fact is a secondary aspect of Reality.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

./configure --with-webuser=apache --with-webgroup=apache \ --with-webdir=/var/www/htdocs --with-cgidir=/var/www/cgi-bin \
ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser \ ZM_DB_PASS=zmdbuserpass

As described in the README and from ./configure --help

Or there is always the alternative of making a backup ie.
cp zm.conf zm.conf.bak
then replace the new config after install
cp zm.conf.bak zm.conf
User avatar
ttsoares
Posts: 31
Joined: Sat Dec 10, 2005 11:06 pm
Contact:

OK - now i understood

Post by ttsoares »

The point is that i was mislead by what "./configure --help" tells:

Some influential environment variables:
ZM_DB_HOST Hostname where ZoneMinder database located
ZM_DB_NAME Name of ZoneMinder database
ZM_DB_USER Name of ZoneMinder database user
ZM_DB_PASS Password of ZoneMinder database user

For me, "environment variables" is different from "passed parameters".

Anyway, i feel that "make install" should create a new zm.conf, like in zm.conf-new and do not mess at all with one already existing zm.conf in the system.

Thanks Cordel...
The fact is a secondary aspect of Reality.
Locked