diff --git a/debian/changelog b/debian/changelog index 88b850b..b320316 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +nut (2.6.4-2.2) unstable; urgency=low + + * Non-maintainer upload with fixes for wheezy. + * Only remove /etc/init.d/nut from previous versions of nut in nut-server + postinst if there are no local changes. + * Also remove /etc/init.d/nut in nut-client postinst. Thanks to + Laurent Bigonville for the hint. + * Only fix permissions of configfiles on first install. + * debian/control: Fix typo in package description. Thanks to Julien Cristau + for spotting this. + + -- Ivo De Decker Thu, 20 Dec 2012 20:40:01 +0100 + nut (2.6.4-2.1) unstable; urgency=low * Non-maintainer upload. diff --git a/debian/control b/debian/control index e3db9c0..63e772e 100644 --- a/debian/control +++ b/debian/control @@ -33,7 +33,7 @@ Description: network UPS tools - metapackage through the server, and are notified whenever the power status changes. . - This package is a metapackage that install both nut-server and nut-client, + This package is a metapackage that installs both nut-server and nut-client, in most cases it is sufficient for a basic UPS monitoring system. Package: nut-server diff --git a/debian/nut-client.postinst b/debian/nut-client.postinst index 8546a95..869752e 100644 --- a/debian/nut-client.postinst +++ b/debian/nut-client.postinst @@ -19,15 +19,18 @@ case "$1" in # fi # make sure that conffiles are secured and have the correct ownerships - if [ -d /etc/nut/ ] ; then - chown root:nut /etc/nut/ - fi - for file in nut.conf upsmon.conf upssched.conf ; do - if [ -f /etc/nut/$file ] ; then - chown root:nut /etc/nut/$file - chmod 640 /etc/nut/$file + # on first install + if [ -z "$2" ] ; then + if [ -d /etc/nut/ ] ; then + chown root:nut /etc/nut/ fi - done + for file in nut.conf upsmon.conf upssched.conf ; do + if [ -f /etc/nut/$file ] ; then + chown root:nut /etc/nut/$file + chmod 640 /etc/nut/$file + fi + done + fi # make sure that /var/run/nut exists and has the correct ownerships if [ ! -d /var/run/nut ] ; then @@ -37,6 +40,16 @@ case "$1" in chown root:nut /var/run/nut chmod 770 /var/run/nut fi + + if dpkg --compare-versions "$2" le "2.6.4-2~" && + [ -f /etc/init.d/nut ] ; then + if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then + rm -f /etc/init.d/nut + else + mv /etc/init.d/nut /etc/init.d/nut.dpkg-old + fi + update-rc.d nut remove >/dev/null + fi ;; abort-upgrade) diff --git a/debian/nut-server.postinst b/debian/nut-server.postinst index d0ec14b..45a3a44 100644 --- a/debian/nut-server.postinst +++ b/debian/nut-server.postinst @@ -19,15 +19,18 @@ case "$1" in # fi # make sure that conffiles are secured and have the correct ownerships - if [ -d /etc/nut/ ] ; then - chown root:nut /etc/nut/ - fi - for file in ups.conf upsd.conf upsd.users ; do - if [ -f /etc/nut/$file ] ; then - chown root:nut /etc/nut/$file - chmod 640 /etc/nut/$file + # on first install + if [ -z "$2" ] ; then + if [ -d /etc/nut/ ] ; then + chown root:nut /etc/nut/ fi - done + for file in ups.conf upsd.conf upsd.users ; do + if [ -f /etc/nut/$file ] ; then + chown root:nut /etc/nut/$file + chmod 640 /etc/nut/$file + fi + done + fi # make sure that /var/run/nut exists and has the correct ownerships if [ ! -d /var/run/nut ] ; then @@ -50,8 +53,13 @@ case "$1" in # 557178 udevadm trigger --subsystem-match=usb - if dpkg --compare-versions "$2" le "2.6.4-2~" ; then - rm -f /etc/init.d/nut + if dpkg --compare-versions "$2" le "2.6.4-2~" && + [ -f /etc/init.d/nut ] ; then + if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then + rm -f /etc/init.d/nut + else + mv /etc/init.d/nut /etc/init.d/nut.dpkg-old + fi update-rc.d nut remove >/dev/null fi ;;