RPM to update ZMliveCD 1.19.5 to 1.21.0

Support and queries relating to third party Live CDs and DVD, VM images and other packaged distributions
Post Reply
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

RPM to update ZMliveCD 1.19.5 to 1.21.0

Post by rdmelin »

Thank you all for your patience.

Disclaimer: I have made every effort to provide a solution that will allow you to upgrade your ZMliveCD installation to ZM 1.21.0 while retaining all saved video events. I cannot however provide any guaranties. If you have saved events that are dear to your heart, please back them up.
Also it is important that you follow the installation steps in sequence, carefully.

You can find an RPM package here:
http://download.computerntelecom.com/pu ... .0/extras/

Here is the installation sequence:

1. Do not uninstall your current ZM installation. Neither do you need to stop ZM as the RPM install will stop it before copying files.

2. Using sudo, or a root shell, enter:
"rpm -Uvh --nodeps zm-1.21.0-3_mdk_10.0.i586.rpm "
If you do not use the --nodeps switch rpm will complain that you need perl-Unicode-Map perl-Unicode-String and perl-X10. You can install perl-Unicode-Map and perl-Unicode-String with urpmi or rpmdrake. perl-X10 you can install with CPAN which is already set up for you. But rpm will still be unaware of perl-X10 so you will still need the --nodeps switch.

3. Still as root, run:
"zminit"
You will be asked for the name of your MySQL administrator. Enter:
"root"
You will then be prompted for a password. Enter:
"mko0nji9" (Unless you have changed the MySQL root password (Not the system root password))

4. Still root, run:
"/var/lib/zm/upgrade/zmdbupgrade 1.19.5"

5. Now you are ready to start the new version of ZM with:
"service zm start"

The RPM package should work on any properly configured Mandrake 10.0 system. Upgrading from a 1.19.5 rpm package is untested. A Mandrake 10.1 rpm will be posted soon.

Best regards

Ross
Last edited by rdmelin on Fri Jun 20, 2008 6:31 pm, edited 4 times in total.
2tomcats
Posts: 13
Joined: Sat Oct 30, 2004 10:59 am

403

Post by 2tomcats »

---
wget http://download.computerntelecom.com/pu ... 0.i586.rpm
--03:07:00-- http://download.computerntelecom.com/pu ... 0.i586.rpm
=> `zm-1.21.0-2_mdk_10.0.i586.rpm'
Resolving download.computerntelecom.com... 67.168.149.250
Connecting to download.computerntelecom.com[67.168.149.250]:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
03:07:01 ERROR 403: Forbidden.
---
Uhm, do we have a problem here? ;-)

Uli
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

I don't understand how this server is configured. Follow the link (from the first post) with your browser, and then you will have access.

Or try this link:
http://www.elltel.net/melins/mdk_10.0/z ... 0.i586.rpm

Note: For any of you who got and installed v. ..-2_mdk_10.0... it was compiled without support for hashed authentication. Please download the latest and just install it with "rpm -Uvh --nodeps ..."
It will not be necessary to do the zminit and zmdbupgrade steps again.
Sorry for the inconvenience.

Ross
Eklectick
Posts: 127
Joined: Sat Nov 20, 2004 1:12 am

Post by Eklectick »

Hi Ross!

I did not hesitate when I saw this and downloaded it immediately.

I was very impressed to see that the procedure was very straight forward and easy so decided to try it.

My first try of course (following your Disclaimer lol) was on a clean install using your LiveCD 1.19.5 and everything went dandy. I was a little worried on step number 3 after running "zminit" and using root and the password after which I got this:

Code: Select all

ERROR 1062 (23000) at line 377: Duplicate entry 'admin' for key 3
Loading config from '/var/lib/zm/init/zmconfig.txt'
Loading config from '/etc/zm.conf'
Loading config from DB
Saving config to DB
Nevertheless, ignoring this, followed steps 4 and 5 and the upgrade was in order.

On the adventurous side, I said what the heck, and grabbed another machine where I have a capture card with a camera, an axis netcam and a Dlink netcam with a bunch of events, as well as archived ones and with PurgeWhenFull going on a 95% full disk.

I would like to mention that after step number 2, it took quite some time to get prompt back, but finally it did came, so my suggestion for the impatient (like me) is to be patient and leave it alone until the RPM does its job before "Ctrl-C ing" it here. I think this does depend on particular installations so, be patient :-)

Once again after step 3 "zminit" root and password I got this on this particular machine:

Code: Select all

ERROR 1062 at line 381: Duplicate entry 'PurgeWhenFull' for key 1
Loading config from '/var/lib/zm/init/zmconfig.txt'
Loading config from '/etc/zm.conf'
Loading config from DB
Saving config to DB
Ignored this, followed steps 4 and 5 (here on step 5, some time followed, so my suggestion too is to be patient here :-) ) and the upgrade was in order too!

So for me, this RPM is, up to now, working great, good job Ross, thanks! You have made installation and upgrading so easy, it could be considered a sin LOL .

On another note and perhaps nothing to do with the RPM, I was anxious to try this new feature Phil introduced with PTZ cameras. I am still disecting and trying to digest the Readme to try to make an Axis 2130R camera of a friend of mine to work. Phil mentions he had the oportunity to work with a Panasonic netcam with PTZ capabilities and does include a "zmcontrol-kx-hcm10.pl" file that is to be found on "/usr/local/bin/" as well as other files for local PTZ cameras, but this directory has no files in it after running the RPM. Would you know if these files are located perhaps on another directory (did a "locate zmcontrol" but nothing popped). Or perhaps need to be "generated" into there by some other means?

Kudos Ross!

Regards!

P.S. Phil could I persuade you to create a new forum (under Support or Development perhaps) with a little more light on how-to´s to create scripts to handle PTZ netcams? I am trying to gather info on this Axis 2130R PTZ netcam on how to issue commands to it and get it working. Thanks!
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Are you sure you are actually running 1.21.1 amd not still 1.19.5?

The duplicate entry errors appear to suggest that the DB schema updates are being run twice, but as you have discovered you can probably ignore these errors.

Adding Axis PTZ support should be pretty simple once you find the KX-HCM10 file to base it on and have a look at the Axis developer help pages (which are really good). If you do get this camera working I'd appreciate it if you sent me the file back. These cameras are way too expensive for me to be able to afford one but I would like to support them.

I don't think there's enough PTZ related traffic at the moment to justify another forum at the moment but if it picks up I'll probably create one.

Phil
Eklectick
Posts: 127
Joined: Sat Nov 20, 2004 1:12 am

Post by Eklectick »

Phil

I had to download zm-1.21.0.tar.gz and inside it i found "zmcontrol-kx-hcm10.pl.z".
Ok, so, the thing is, "zmcontrol-kx-hcm10.pl" (without the "z") should be in "/usr/local/bin/"
1. What do I have to do to it to get it in there working?

I edited the file and do see (or at least try to figure) what the commands for PTZ on this particular cam are.
2. Could you point me to the developer file or webpage for the KX-HCM10 so that I can correlate the commands of the Axis 2130R and try to make it work?

Regards!

P.S. I am sure this post does not belong here but since the thread started here I will post, please do move it into the appropiate place. Thanks!
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

Sorry I missed your question earlier in this thread. I just noticed the date on it.

zmcontrol-kx-hcm10.pl will be installed in /usr/bin as will all the other zm executables with this RPM installation.

BTW "locate" accesses a database of all your files that is periodically updated by a cron script. You can update it manually if you want after installing some package(s) to find where things have been put. As root or sudo run "updatedb" It takes a couple minutes or so as it has to search your harddrives.

Another tool you can use is "rpm -q --filesbypkg zm" or whatever package you're interested in. This does not have to be run as root.

And yes I probably should have warned about the duplicate key errors. :)
It's actually your DB getting hit with zmschema.sql (patched version)

And good that you point out the need for patience especially on an upgrade with lots of saved events and a big database. If upgrading from a previous version RPM alot of files may have to be moved to another location. If you were to control-C out you might as well dig out your LiveCD and start over :(

Best regards,

Ross
ekiboy69
Posts: 101
Joined: Tue Jun 22, 2004 9:26 pm
Location: Kaarina-Finland

Upgrade 1.21.0 -> 1.21.4 -> 1.22.1 fails with DB probl

Post by ekiboy69 »

Hi,

I tried to upgrade a Ross' Mandrake 10.1 LiveCD based installation using RPMs at http://www.elltel.net/melins/mdk_10.1/RPMS/

Procedure:

First install 1.21. This went OK.

reboot

After that I installed 1.22.1. For some reason the DB update or alteration does not seem to work:

[/usr/lib/zm/bin]# ./zminit
Enter MySQL Administrator username(Default: root and password is blank)MySQL Admin: root
Enter password:
ERROR 1062 at line 440: Duplicate entry 'admin' for key 2
Update agent starting at 06/05/15 10:43:01

Freshening configuration in database
Loading config from DB
No option 'ZM_NO_MAX_FPS_ON_ALARM' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_VIDEO_STREAM_METHOD' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_VIDEO_TIMED_FRAMES' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_VIDEO_LIVE_FORMAT' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_VIDEO_REPLAY_FORMAT' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_EVENT_SORT_FIELD' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_EVENT_SORT_ORDER' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_WEB_H_IMAGE_SCALING' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_WEB_M_IMAGE_SCALING' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_WEB_L_IMAGE_SCALING' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_WEB_P_REFRESH_MAIN' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
No option 'ZM_WEB_P_REFRESH_IMAGE' found, removing at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/ConfigAdmin.pm line 1627.
Saving config to DB
Update agent exiting at 06/05/15 10:43:02
error reading information on service mysqld: No such file or directory

And:

[/usr/lib/zm/bin]# service zm start
Upgrade ZoneMinder database: Update agent starting at 06/05/15 10:45:41

Initiating database upgrade to version 1.22.1

Upgrading database to version 1.22.1
ERROR 1054 at line 4: Unknown column 'RunMode' in 'Monitors'
Output:
Command 'mysql -hlocalhost -uzm_admin -pzaq1xsw2 zm < /usr/lib/zm/upgrade/zm_update-1.21.4.sql' exited with status: 1

I am certainly missing something here but what?

/elias
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

[/usr/lib/zm/bin]# ./zminit
This should not be needed on an upgrade, only a new RPM installation. It may have caused the problem following. (I know this is not clearly explained anywhere :( I will add a note in the RPM sticky thread.)

All that should be needed is to restart the zm service. Database updates are then applied by scripts that assume the detected old version accurately represents the current table structure and applies the changes in a sequence versionN, versionN+1...to the current version. If something happens out of sequence the database gets borked and the update scripts error out.
Upgrading database to version 1.22.1
ERROR 1054 at line 4: Unknown column 'RunMode' in 'Monitors'
Output:
Command 'mysql -hlocalhost -uzm_admin -pzaq1xsw2 zm < /usr/lib/zm/upgrade/zm_update-1.21.4.sql' exited with status: 1

This one is harmless. I'll track it down and fix for the next release.
error reading information on service mysqld: No such file or directory
The good news is you don't need to reinstall the system :)
Just drop the zm database and run zminit again and it will recreate the database with the correct structure without the whole cascading updates routine.
That should be all that needed to get you going with 1.22.1
ekiboy69
Posts: 101
Joined: Tue Jun 22, 2004 9:26 pm
Location: Kaarina-Finland

Consequences of dropping the table?

Post by ekiboy69 »

This is all very comforting :-)

Only problem is that I really need the data in the database. Does dropping the table mean I am going to lose the data?

/ekiboy69
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

Only problem is that I really need the data in the database. Does dropping the table mean I am going to lose the data?
Yes. Sorry, I thought you meant you were upgrading a from a fresh livecd installation. I'm afraid that the database is in disarray now. :(
Perhaps someone with more MySQL savvy than me can help straighten it out.

I am reworking zminit so that it will detect an existing database and not trample on it.
ekiboy69
Posts: 101
Joined: Tue Jun 22, 2004 9:26 pm
Location: Kaarina-Finland

OK - I will find someone to help me

Post by ekiboy69 »

Hi,

Thanks for the information. I will find someone to help me with the DB.

This is BTW the first time I have had trouble with your RPMs. They've been working like a dream until now.
ekiboy69
Posts: 101
Joined: Tue Jun 22, 2004 9:26 pm
Location: Kaarina-Finland

Is there a way to do the conversion manually?

Post by ekiboy69 »

One more thing: as there are instructions on how to do the DB conversion manually (when installing ZM update from a gz-packet) I wonder if there's a way to do the conversion manually?
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

Sorry about the slow reply. My internet service was down all day yesterday :cry:

There aren't instructions per say but if you look in the bd/ subdirectory of the tarball you will find a number of zm_update-????.sql files. These just contain the sql statements applied to the database to update from one version to the next.

So doing "mysql -u root -p < zm_update-1.22.0.sql" would be the same as loging in to mysql and entering those statements one at a time. The update script just applies these .sql files in sequence.

Your troubles are caused by zminit applying the zm_create.sql to an already existing db. zm_create.sql contains the sql statements to initialize and empty db.

I think if you look at these files you will understand how they work, but undoing changes may be complicated :(
ekiboy69
Posts: 101
Joined: Tue Jun 22, 2004 9:26 pm
Location: Kaarina-Finland

Thanks for the reply

Post by ekiboy69 »

I'll try to find someone who is familiar to mysql and can help me out.

Best regards,

/elias
Post Reply