Page 1 of 3

Thanks for the Debian packages, Peter!

Posted: Wed Feb 07, 2007 7:32 am
by Flash_
Sorry for starting another thread, but I couldn't reply to the announcement one at http://www.zoneminder.com/forums/viewto ... ght=debian

I just wanted to thank Peter for his hard work in doing these packages, will make us debianites' lives much easier.

Two questions; Can I install these over an existing installation?

If this goes wrong, after I apt-get --remove it, a "make install" from my original tarball should replace everything with a known working copy?

(Sorry - despite having used Debian for a long time, I've never actually replaced a critical source-built application with a .deb one)

Posted: Wed Feb 07, 2007 7:41 am
by bjs
i agree, how nice with a real .deb pack!

Posted: Wed Feb 07, 2007 11:22 pm
by PeterHoward
First, you're welcome.

As to installing over an existing installation: The main problem which springs to mind is that, assuming you didn't use something like checkinstall to create an on-the-fly debian package, the install will want to create the database. Given it already exists the install will fail, leaving the package not fully installed.

And yes, replace _everything_ if it stuffs up.


If you're not worried about losing what's currently in your db, I'd do the following.

* "make uninstall" from your build area,
* make sure the zm database is gone,
* "seek and destroy" any leftover config files,
* install the zoneminder package,

PJH

Read he README

Posted: Wed Feb 07, 2007 11:32 pm
by PeterHoward
Oops, I'll say it here as well; make sure you read the installed README, as post-installation you don't get apache seeing the zoneminder pages by default; you have to do one manual "ln -s".

Posted: Thu Feb 08, 2007 7:33 am
by Flash_
What if I renamed the existing ZM database in sql.

"make uninstall" the existing.

Install the new .deb and let it create a new database. Finish install.

Delete new database and copy original back into its place.

Restart sql and ZM.

Sound reasonable?

Posted: Thu Feb 08, 2007 7:43 am
by cordel
How about just:
:arrow: dumping your database (I did a backup script some time back to backup config, could easily be modified to do the whole database by adding the rest of the tables).
:arrow: Drop the database
:arrow: install package
:arrow: restore the database (Created a script for this some time back as well, no modifications would need to be done).

The both scripts are in a post somewhere under the contribs topic.

Posted: Thu Feb 08, 2007 7:55 am
by cordel

Posted: Fri Feb 09, 2007 6:53 am
by Flash_
Heh - yes, that does sound easier. Thanks!

No Offense...

Posted: Wed Feb 14, 2007 3:31 pm
by nodesyn
But this package SUCKS... it has completely broken apt and dpkg i cannot remove it I cannot reinstall it to remove it... I will do a source install any day over going through that problem again.

Here's an example..
This software is great don't get me wrong... but this debian package destroyed apt totally on my ubuntu system.

sudo dpkg --purge zoneminder
dpkg: error processing zoneminder (--purge):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
zoneminder
nodesyn@nexus:~/Desktop$ sudo dpkg -r zoneminder
dpkg: error processing zoneminder (--remove):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
zoneminder

This is a result of the package trying to set itself up in mysql well there is no documentation... so.. what you have to do go create the mysql database either through command line or phpmyadmin or whatever you preference may be.

You HAVE to make the user zmuser AND MAKE SURE THE PASSWORD IS "zmpass" ..... if you dont do this apt will inevitably break you won't be able to update any packages download or install any new packages until you resolve this problem.

And yet... regardless of addressing that problem itself... the package breaks at least on my system anyway. If anyone is having any problems recovering on this issue feel free to email me... nodesyn@nexusconnect.com and I will be willing to help you repair it.

Minimal offence taken

Posted: Wed Feb 14, 2007 11:56 pm
by PeterHoward
But this package SUCKS... it has completely broken apt and dpkg i cannot remove it I cannot reinstall it to remove it... I will do a source install any day over going through that problem again.
A little more information here and I should be able to correct the problem. Yes, I have gone through a variant of the "apt messed up" situation below, and I thought I had removed any such situation.
Here's an example..
This software is great don't get me wrong... but this debian package destroyed apt totally on my ubuntu system.

sudo dpkg --purge zoneminder
dpkg: error processing zoneminder (--purge):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
zoneminder
nodesyn@nexus:~/Desktop$ sudo dpkg -r zoneminder
dpkg: error processing zoneminder (--remove):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
zoneminder
Was there no more information in the above? I would have expected to see the error(s) from the uninstall scripts.
This is a result of the package trying to set itself up in mysql well there is no documentation... so.. what you have to do go create the mysql database either through command line or phpmyadmin or whatever you preference may be.
? Yes, the package tries to set up mysql. As you have to do with the source install. I can only see two possibilities there:
    • You had already installed from source[/list=]
      • You didn't have the mysql server installed and setup[/list=]
      The former is easily fixable (if it's the problem . . . from memory the mysql script already checks for that). For the latter, I can make it a dependency - it just means you have to have the server on the same system. Which may make sense from a preformance POV anyway.
      You HAVE to make the user zmuser AND MAKE SURE THE PASSWORD IS "zmpass" ..... if you dont do this apt will inevitably break you won't be able to update any packages download or install any new packages until you resolve this problem.

      And yet... regardless of addressing that problem itself... the package breaks at least on my system anyway.
      Can you supply details? What's the exact system?
      If anyone is having any problems recovering on this issue feel free to email me... nodesyn@nexusconnect.com and I will be willing to help you repair it.
      It's fairly straightforward to fix: The process is to edit /var/lib/dpkg/lib/info/zoneminder.postinst and /var/lib/dpkg/lib/info/zoneminder.postrm to have "exit 0" as the first command executed. Then the install/uninstall can complete easily enough.

      PJH

Posted: Thu Feb 15, 2007 12:16 pm
by jameswilson
by all means say the package has bugs etc, but dont attack the guy that did this. Peter thankyou for your efforts i for one appricate you.

Please keep al tone civil and be grateful for the time that we all put into this project

James

Posted: Thu Feb 15, 2007 11:15 pm
by PeterHoward
James, thanks for the support. In the above case, I forgave the tone as soon as I saw he'd been stuck in "dpkg hell" - having been caught there a couple of times while developing the packages I know how it feels. You get the splitting headache, _then_ you start banging your head against the wall/grater combo :)

Re: Minimal offence taken

Posted: Fri Feb 16, 2007 2:16 am
by PeterHoward
PeterHoward wrote:[
? Yes, the package tries to set up mysql. As you have to do with the source install. I can only see two possibilities there:
  • You had already installed from source
    You didn't have the mysql server installed and setup
The former is easily fixable (if it's the problem . . . from memory the mysql script already checks for that). For the latter, I can make it a dependency - it just means you have to have the server on the same system. Which may make sense from a preformance POV anyway.
Actually, mysql-server is a dependency. So it should have been installed. It looks like there is a problem here if that's the first install of MySQL. I'll have to think about that . . .

Same problem.. more messages

Posted: Fri Feb 16, 2007 2:46 am
by stackbit
after

dpkg - i zoneminder_1.22.3...
apt-get install -f
dpkg -i gives:

debian1:/tmp# dpkg -i zoneminder_1.22.3-1_i386.deb
(Lendo a base de dados ... 18884 ficheiros e directórios actualmente instalados.)
A preparar para substituir zoneminder 1.22.3-1 (a usar zoneminder_1.22.3-1_i386.deb) ...
Stopping ZoneMinder: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmpkg.pl line 45.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 45.
failure

invoke-rc.d: initscript zoneminder, action "stop" failed.
dpkg: aviso - script pre-removal antigo retornou erro do status de saída 255
dpkg - em vez disso a tentar script do novo pacote ...
Stopping ZoneMinder: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmpkg.pl line 45.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 45.
failure

invoke-rc.d: initscript zoneminder, action "stop" failed.
dpkg: erro processando zoneminder_1.22.3-1_i386.deb (--install):
subprocesso novo script pre-removal retornou erro do status de saída 255
Starting ZoneMinder: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmpkg.pl line 45.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 45.
failure

invoke-rc.d: initscript zoneminder, action "start" failed.
dpkg: erro enquanto limpava:
subprocesso post-installation script retornou erro do status de saída 255
Foram encontrados erros enquanto processava:
zoneminder_1.22.3-1_i386.deb

zoneminder is stuck in reinstall limbo.. :(

Posted: Fri Feb 16, 2007 3:00 am
by stackbit
i did the exit 0 and it almost worked.. Had to do it do .prerm file too.

Then i reinstalled the zoneminder deb.. but...

debian1:/tmp# dpkg -i zoneminder_1.22.3-1_i386.deb
A seleccionar pacote anteriormente não seleccionado zoneminder
(Lendo a base de dados ... 18677 ficheiros e directórios actualmente instalados.)
A descompactar zoneminder (desde zoneminder_1.22.3-1_i386.deb) ...
A instalar zoneminder (1.22.3-1) ...
Starting ZoneMinder: DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/ZoneMinder/Config.pm line 89
Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/ZoneMinder/Config.pm line 91.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 100.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmpkg.pl line 45.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 45.
failure

invoke-rc.d: initscript zoneminder, action "start" failed.
dpkg: erro processando zoneminder (--install):
subprocesso post-installation script retornou erro do status de saída 255
Foram encontrados erros enquanto processava:
zoneminder

It seems you need to create a zmuser in mysql...