Bug#583648: zoneminder: diff for NMU version 1.24.2-4.1
On Thu, 01 Jul 2010 22:11:55 +0100, Julien Cristau wrote: > > > > + if $(/etc/init.d/mysql status >/dev/null 2>&1); then > > > What is this trying to test? [..] > > Seems to work fine: [..] > It would be clearer without the ``$( )'', IMO... Agreed, it's not very well readable that way. For the NMU I (and probably Vagrant too when preparing the patch) wanted to keep the maintainer's style but maybe the maintainer can use the proposal for clarification in a future upload. Cheers, gregor -- .''`. http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4 : :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/ `. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe `-NP: Nick Cave And The Bad Seeds: Get Ready For Love signature.asc Description: Digital signature
Bug#583648: zoneminder: diff for NMU version 1.24.2-4.1
On Thu, Jul 1, 2010 at 22:46:49 +0200, gregor herrmann wrote: > On Thu, 01 Jul 2010 21:05:14 +0100, Julien Cristau wrote: > > > > + if $(/etc/init.d/mysql status >/dev/null 2>&1); then > > What is this trying to test? Redirecting the command's stdout and > > stderr to /dev/null and testing if the output is empty doesn't seem very > > useful... > > Seems to work fine: > > r...@guinan:~# /etc/init.d/mysql start > Starting MySQL database server: mysqld .. > Checking for corrupt, not cleanly closed and upgrade needing tables.. > r...@guinan:~# if $(/etc/init.d/mysql status >/dev/null 2>&1); then echo $? > "MySQL up"; else echo $? "No MySQL"; fi > 0 MySQL up > r...@guinan:~# /etc/init.d/mysql stop > Stopping MySQL database server: mysqld. > r...@guinan:~# if $(/etc/init.d/mysql status >/dev/null 2>&1); then echo $? > "MySQL up"; else echo $? "No MySQL"; fi > 3 No MySQL > r...@guinan:~# > It would be clearer without the ``$( )'', IMO... Cheers, Julien signature.asc Description: Digital signature
Bug#583648: zoneminder: diff for NMU version 1.24.2-4.1
On Thu, 01 Jul 2010 21:05:14 +0100, Julien Cristau wrote: > > + if $(/etc/init.d/mysql status >/dev/null 2>&1); then > What is this trying to test? Redirecting the command's stdout and > stderr to /dev/null and testing if the output is empty doesn't seem very > useful... Seems to work fine: r...@guinan:~# /etc/init.d/mysql start Starting MySQL database server: mysqld .. Checking for corrupt, not cleanly closed and upgrade needing tables.. r...@guinan:~# if $(/etc/init.d/mysql status >/dev/null 2>&1); then echo $? "MySQL up"; else echo $? "No MySQL"; fi 0 MySQL up r...@guinan:~# /etc/init.d/mysql stop Stopping MySQL database server: mysqld. r...@guinan:~# if $(/etc/init.d/mysql status >/dev/null 2>&1); then echo $? "MySQL up"; else echo $? "No MySQL"; fi 3 No MySQL r...@guinan:~# Cheers, gregor -- .''`. http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4 : :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/ `. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe `-NP: Peter Ratzenbeck: Der Ohrwurm signature.asc Description: Digital signature
Bug#583648: zoneminder: diff for NMU version 1.24.2-4.1
On Thu, Jul 1, 2010 at 21:49:03 +0200, gregor herrmann wrote: > tags 583648 + pending > thanks > > Dear maintainer, > > I've prepared an NMU for zoneminder (versioned as 1.24.2-4.1) and > uploaded it to DELAYED/2. Please feel free to tell me if I > should delay it longer. > > Regards. > > -- > .''`. http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4 > : :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/ > `. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe >`-NP: Queen: Under Pressure > diff -u zoneminder-1.24.2/debian/changelog zoneminder-1.24.2/debian/changelog > --- zoneminder-1.24.2/debian/changelog > +++ zoneminder-1.24.2/debian/changelog > @@ -1,3 +1,12 @@ > +zoneminder (1.24.2-4.1) unstable; urgency=low > + > + * Non-maintainer upload. > + * Fix "package removed, processes still running": apply patch to > +debian/postinst by Vagrant Cascadian: use invoke-rc.d and run > +mysql-related actions only when mysql is running (closes: #583648). > + > + -- gregor herrmann Thu, 01 Jul 2010 19:47:10 +0200 > + > zoneminder (1.24.2-4) unstable; urgency=high >* Update init.d to list mysql dependency > (closes: #583505) > diff -u zoneminder-1.24.2/debian/postinst zoneminder-1.24.2/debian/postinst > --- zoneminder-1.24.2/debian/postinst > +++ zoneminder-1.24.2/debian/postinst > @@ -10,21 +10,29 @@ > # Get mysql started if it isn't > # > if ! $(/etc/init.d/mysql status >/dev/null 2>&1); then > - /etc/init.d/mysql start > + invoke-rc.d mysql start > + fi > + if $(/etc/init.d/mysql status >/dev/null 2>&1); then What is this trying to test? Redirecting the command's stdout and stderr to /dev/null and testing if the output is empty doesn't seem very useful... > + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f > reload > + cat /usr/share/zoneminder/db/zm_create.sql | mysql > --defaults-file=/etc/mysql/debian.cnf > + echo 'grant lock tables, > alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by > "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql > + else > + echo 'NOTE: mysql not running, please start mysql and > run dpkg-reconfigure zoneminder when it is running.' > fi > - mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload > - cat /usr/share/zoneminder/db/zm_create.sql | mysql > --defaults-file=/etc/mysql/debian.cnf > - echo 'grant lock tables, alter,select,insert,update,delete on > zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql > --defaults-file=/etc/mysql/debian.cnf mysql > chown www-data:www-data /var/log/zm > chown www-data:www-data /var/lib/zm/ > chown www-data:www-data -R /var/cache/zoneminder > else > -echo 'grant lock tables, alter on zm.* to 'zmuser'@localhost > identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql > chown www-data:www-data /var/log/zm > -OLD_ZM_VERSION=${2%-*} > -if [ "$OLD_ZM_VERSION" != "$VERSION" ] ; then > -zmupdate.pl --version $OLD_ZM_VERSION > -fi > + if $(/etc/init.d/mysql status >/dev/null 2>&1); then > + echo 'grant lock tables, alter on zm.* to 'zmuser'@localhost > identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql > +OLD_ZM_VERSION=${2%-*} > +if [ "$OLD_ZM_VERSION" != "$VERSION" ] ; then > +zmupdate.pl --version $OLD_ZM_VERSION > +fi > + else > + echo 'NOTE: mysql not running, please start mysql and > run dpkg-reconfigure zoneminder when it is running.' > + fi > fi > fi > #DEBHELPER# Cheers, Julien signature.asc Description: Digital signature
Bug#583648: zoneminder: diff for NMU version 1.24.2-4.1
tags 583648 + pending thanks Dear maintainer, I've prepared an NMU for zoneminder (versioned as 1.24.2-4.1) and uploaded it to DELAYED/2. Please feel free to tell me if I should delay it longer. Regards. -- .''`. http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4 : :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/ `. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe `-NP: Queen: Under Pressure diff -u zoneminder-1.24.2/debian/changelog zoneminder-1.24.2/debian/changelog --- zoneminder-1.24.2/debian/changelog +++ zoneminder-1.24.2/debian/changelog @@ -1,3 +1,12 @@ +zoneminder (1.24.2-4.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix "package removed, processes still running": apply patch to +debian/postinst by Vagrant Cascadian: use invoke-rc.d and run +mysql-related actions only when mysql is running (closes: #583648). + + -- gregor herrmann Thu, 01 Jul 2010 19:47:10 +0200 + zoneminder (1.24.2-4) unstable; urgency=high * Update init.d to list mysql dependency (closes: #583505) diff -u zoneminder-1.24.2/debian/postinst zoneminder-1.24.2/debian/postinst --- zoneminder-1.24.2/debian/postinst +++ zoneminder-1.24.2/debian/postinst @@ -10,21 +10,29 @@ # Get mysql started if it isn't # if ! $(/etc/init.d/mysql status >/dev/null 2>&1); then - /etc/init.d/mysql start + invoke-rc.d mysql start + fi + if $(/etc/init.d/mysql status >/dev/null 2>&1); then + mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload + cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf + echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql + else + echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' fi - mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload - cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf - echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql chown www-data:www-data /var/log/zm chown www-data:www-data /var/lib/zm/ chown www-data:www-data -R /var/cache/zoneminder else -echo 'grant lock tables, alter on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql chown www-data:www-data /var/log/zm -OLD_ZM_VERSION=${2%-*} -if [ "$OLD_ZM_VERSION" != "$VERSION" ] ; then -zmupdate.pl --version $OLD_ZM_VERSION -fi + if $(/etc/init.d/mysql status >/dev/null 2>&1); then + echo 'grant lock tables, alter on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql +OLD_ZM_VERSION=${2%-*} +if [ "$OLD_ZM_VERSION" != "$VERSION" ] ; then +zmupdate.pl --version $OLD_ZM_VERSION +fi + else + echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' + fi fi fi #DEBHELPER# signature.asc Description: Digital signature