From 4f4f1f9119ffa81cb86981959ab9dd99faae55ee Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 9 Aug 2012 10:36:09 +0200 Subject: [PATCH 01/21] debian/rules: Stop the nut-client before nut-server on systems using static boot ordering (Closes: #679451) --- debian/changelog | 7 +++++++ debian/rules | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a66b5f5..b0b9fb4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +nut (2.6.4-2) UNRELEASED; urgency=low + + * debian/rules: Stop the nut-client before nut-server on systems using static + boot ordering (Closes: #679451) + + -- Laurent Bigonville Thu, 09 Aug 2012 10:31:05 +0200 + nut (2.6.4-1) unstable; urgency=high * New upstream release (Closes: #671444) diff --git a/debian/rules b/debian/rules index b9eef15..b0745bb 100755 --- a/debian/rules +++ b/debian/rules @@ -76,8 +76,8 @@ common-install-indep:: binary-install/nut-monitor:: dh_python2 -pnut-monitor -DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server -- start 50 2 3 4 5 . stop 50 0 1 6 . -DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client -- start 51 2 3 4 5 . stop 51 0 1 6 . +DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server -- start 50 2 3 4 5 . stop 51 0 1 6 . +DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client -- start 51 2 3 4 5 . stop 50 0 1 6 . DEB_DH_COMPRESS_ARGS_nut-doc := -X.pdf ifeq (linux,$(DEB_HOST_ARCH_OS)) From 080f7baf1401af15d3df8b4495acb18d0762c2db Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 9 Aug 2012 11:05:51 +0200 Subject: [PATCH 02/21] debian/nut-server.maintscript: Remove /etc/init.d/nut on upgrade (Closes: #677822) --- debian/changelog | 4 +++- debian/control | 3 ++- debian/nut-server.maintscript | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 debian/nut-server.maintscript diff --git a/debian/changelog b/debian/changelog index b0b9fb4..1cd47a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ nut (2.6.4-2) UNRELEASED; urgency=low * debian/rules: Stop the nut-client before nut-server on systems using static boot ordering (Closes: #679451) + * debian/nut-server.maintscript: Remove /etc/init.d/nut on upgrade + (Closes: #677822) - -- Laurent Bigonville Thu, 09 Aug 2012 10:31:05 +0200 + -- Laurent Bigonville Thu, 09 Aug 2012 11:04:51 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/control b/debian/control index dbf99d7..3cd034a 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: admin Priority: optional Maintainer: Arnaud Quette Uploaders: Laurent Bigonville -Build-Depends: debhelper (>= 8), +Build-Depends: debhelper (>= 8.1.0~), cdbs (>= 0.4.90~), libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, @@ -42,6 +42,7 @@ Provides: nut-usb Conflicts: nut-hal-drivers, nut-usb (<< 2.1.0-3), nut-dev (<< 2.2.2) Replaces: nut (<< 2.6.1-2~) Breaks: nut (<< 2.6.1-2~) +Pre-Depends: ${misc:Pre-Depends} Description: network UPS tools - core system Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and diff --git a/debian/nut-server.maintscript b/debian/nut-server.maintscript new file mode 100644 index 0000000..1d202d4 --- /dev/null +++ b/debian/nut-server.maintscript @@ -0,0 +1,3 @@ +#Removing obsolete init script. +#The file is gone in 2.6.3-2 but was not removed on upgrades. +rm_conffile /etc/init.d/nut 2.6.4-3~ From e038ffaf38402083baf11a809521f93ca7b334f4 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 9 Aug 2012 11:20:54 +0200 Subject: [PATCH 03/21] Rename nut-server.lintian-overrides to nut-client.lintian-overrides and adjust overrides now that ups-monitor is shipped in nut-client package (Closes: #677947) --- debian/changelog | 5 ++++- debian/nut-client.lintian-overrides | 1 + debian/nut-server.lintian-overrides | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 debian/nut-client.lintian-overrides delete mode 100644 debian/nut-server.lintian-overrides diff --git a/debian/changelog b/debian/changelog index 1cd47a3..c03fca6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,11 @@ nut (2.6.4-2) UNRELEASED; urgency=low boot ordering (Closes: #679451) * debian/nut-server.maintscript: Remove /etc/init.d/nut on upgrade (Closes: #677822) + * Rename nut-server.lintian-overrides to nut-client.lintian-overrides and + adjust overrides now that ups-monitor is shipped in nut-client package + (Closes: #677947) - -- Laurent Bigonville Thu, 09 Aug 2012 11:04:51 +0200 + -- Laurent Bigonville Thu, 09 Aug 2012 11:20:06 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/nut-client.lintian-overrides b/debian/nut-client.lintian-overrides new file mode 100644 index 0000000..4651289 --- /dev/null +++ b/debian/nut-client.lintian-overrides @@ -0,0 +1 @@ +nut-client: script-in-etc-init.d-not-registered-via-update-rc.d diff --git a/debian/nut-server.lintian-overrides b/debian/nut-server.lintian-overrides deleted file mode 100644 index 9618794..0000000 --- a/debian/nut-server.lintian-overrides +++ /dev/null @@ -1,2 +0,0 @@ -nut-server: script-in-etc-init.d-not-registered-via-update-rc.d -nut-server: init.d-script-does-not-provide-itself etc/init.d/ups-monitor From 07ab571061ab91420ed24f73e8b5a81994b55e1b Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 9 Aug 2012 11:39:46 +0200 Subject: [PATCH 04/21] Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched regression (Taken from upstream) (Closes: #679513) --- debian/changelog | 4 +++- debian/patches/0001-fix-upsmon-regression.patch | 15 +++++++++++++++ debian/patches/series | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 debian/patches/0001-fix-upsmon-regression.patch diff --git a/debian/changelog b/debian/changelog index c03fca6..e0fc4b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,10 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Rename nut-server.lintian-overrides to nut-client.lintian-overrides and adjust overrides now that ups-monitor is shipped in nut-client package (Closes: #677947) + * Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched + regression (Taken from upstream) (Closes: #679513) - -- Laurent Bigonville Thu, 09 Aug 2012 11:20:06 +0200 + -- Laurent Bigonville Thu, 09 Aug 2012 11:36:41 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/patches/0001-fix-upsmon-regression.patch b/debian/patches/0001-fix-upsmon-regression.patch new file mode 100644 index 0000000..aa8c13e --- /dev/null +++ b/debian/patches/0001-fix-upsmon-regression.patch @@ -0,0 +1,15 @@ +Description: Fix upsmon/upssched regression +Origin: upstream, http://trac.networkupstools.org/projects/nut/changeset/3670 +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679513 + +Index: /trunk/clients/upssched.c +=================================================================== +--- a/clients/upssched.c (revision 3555) ++++ b/clients/upssched.c (revision 3670) +@@ -695,5 +695,5 @@ + pconf_encode(arg2, enc, sizeof(enc))); + +- snprintfcat(enc, sizeof(enc), "%s\n", buf); ++ snprintf(enc, sizeof(enc), "%s\n", buf); + + /* see if the parent needs to be started (and maybe start it) */ diff --git a/debian/patches/series b/debian/patches/series index 2024d93..f80396c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ +0001-fix-upsmon-regression.patch 0002-nut-monitor-paths.patch From 8a901d6ac1f71803ca75ed600a5f384d19bf8e12 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 9 Aug 2012 11:50:35 +0200 Subject: [PATCH 05/21] Move nut metapackage to Section: metapackages --- debian/changelog | 3 ++- debian/control | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e0fc4b9..468fcc1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,9 @@ nut (2.6.4-2) UNRELEASED; urgency=low (Closes: #677947) * Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched regression (Taken from upstream) (Closes: #679513) + * Move nut metapackage to Section: metapackages - -- Laurent Bigonville Thu, 09 Aug 2012 11:36:41 +0200 + -- Laurent Bigonville Thu, 09 Aug 2012 11:50:08 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/control b/debian/control index 3cd034a..4bd6159 100644 --- a/debian/control +++ b/debian/control @@ -24,6 +24,7 @@ X-Python-Version: >= 2.5 Package: nut Architecture: all +Section: metapackages Depends: ${misc:Depends}, nut-server, nut-client Description: network UPS tools - metapackage Network UPS Tools (NUT) is a client/server monitoring system that From b7d91288c6933d035ffc07fb654542313913dda8 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 9 Aug 2012 21:21:03 +0200 Subject: [PATCH 06/21] Also create nut user when installing nut-client package and do not delete it on purge anymore (Closes: #682000) --- debian/changelog | 4 ++- debian/nut-client.postinst | 60 ++++++++++++++++++++++++++++++++++++++ debian/nut-server.postinst | 2 +- debian/nut-server.postrm | 6 ---- 4 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 debian/nut-client.postinst diff --git a/debian/changelog b/debian/changelog index 468fcc1..18f3303 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,10 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched regression (Taken from upstream) (Closes: #679513) * Move nut metapackage to Section: metapackages + * Also create nut user when installing nut-client package and do not delete + it on purge anymore (Closes: #682000) - -- Laurent Bigonville Thu, 09 Aug 2012 11:50:08 +0200 + -- Laurent Bigonville Thu, 09 Aug 2012 21:18:03 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/nut-client.postinst b/debian/nut-client.postinst new file mode 100644 index 0000000..fbcf657 --- /dev/null +++ b/debian/nut-client.postinst @@ -0,0 +1,60 @@ +#!/bin/sh -e + +case "$1" in + + configure) + + # make sure the nut user exists and has correct memberships + if ! getent group nut >/dev/null; then + addgroup --quiet --system nut + fi + if ! getent passwd nut >/dev/null; then + adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut + elif ! groups nut | grep -qw nut; then + adduser nut nut + fi +# for Ubuntu, while waiting for a proper debconf +# if ! groups nut | grep -qw dialout; then +# adduser nut dialout +# 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 + fi + done + + # make sure that /var/run/nut exists and has the correct ownerships + if [ ! -d /var/run/nut ] ; then + mkdir -p /var/run/nut + fi + if [ -d /var/run/nut ] ; then + chown root:nut /var/run/nut + chmod 770 /var/run/nut + fi + + abort-upgrade) + # do nothing + ;; + + abort-remove) + # do nothing + ;; + + abort-deconfigure) + # do nothing + ;; + + *) + echo "$0: incorrect arguments: $*" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# diff --git a/debian/nut-server.postinst b/debian/nut-server.postinst index a91caab..193676f 100644 --- a/debian/nut-server.postinst +++ b/debian/nut-server.postinst @@ -22,7 +22,7 @@ case "$1" in if [ -d /etc/nut/ ] ; then chown root:nut /etc/nut/ fi - for file in nut.conf ups.conf upsd.conf upsmon.conf upsd.users upssched.conf ; do + 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 diff --git a/debian/nut-server.postrm b/debian/nut-server.postrm index 38b8d52..1ca0437 100644 --- a/debian/nut-server.postrm +++ b/debian/nut-server.postrm @@ -14,12 +14,6 @@ case "$1" in rm -f /etc/udev/rules.d/025_nut-usbups.rules rm -f /etc/udev/rules.d/52_nut-usbups.rules rm -f /etc/udev/rules.d/52-nut-usbups.rules - # remove the nut user - if [ -x "$(command -v deluser)" ]; then - deluser --quiet --system nut > /dev/null || true - else - echo >&2 "not removing nut system account because deluser command was not found" - fi # handle a dpkg bug [ -d /etc/nut ] && rmdir --ignore-fail-on-non-empty /etc/nut >/dev/null 2>&1 ;; From a5828413ec5817242e77a7f4ebab795be90b8683 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 9 Aug 2012 21:40:24 +0200 Subject: [PATCH 07/21] =?UTF-8?q?Drop=20/etc/default/nut=20=E2=86=92=20/et?= =?UTF-8?q?c/nut/nut.conf=20migration=20code,=20migration=20happends=20bef?= =?UTF-8?q?ore=20squeeze=20release=20(Closes:=20#684392)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 4 ++- debian/nut-server.postinst | 63 -------------------------------------- debian/nut-server.preinst | 7 ----- 3 files changed, 3 insertions(+), 71 deletions(-) diff --git a/debian/changelog b/debian/changelog index 18f3303..c569455 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,8 +12,10 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Move nut metapackage to Section: metapackages * Also create nut user when installing nut-client package and do not delete it on purge anymore (Closes: #682000) + * Drop /etc/default/nut → /etc/nut/nut.conf migration code, migration + happends before squeeze release (Closes: #684392) - -- Laurent Bigonville Thu, 09 Aug 2012 21:18:03 +0200 + -- Laurent Bigonville Thu, 09 Aug 2012 21:32:09 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/nut-server.postinst b/debian/nut-server.postinst index 193676f..c2574b8 100644 --- a/debian/nut-server.postinst +++ b/debian/nut-server.postinst @@ -49,69 +49,6 @@ case "$1" in && udevadm trigger --subsystem-match=usb --action=change # 557178 udevadm trigger --subsystem-match=usb - - # migrate /etc/default/nut to /etc/nut/nut.conf (part #2) - if dpkg --compare-versions "$2" lt-nl "2.4.1-2" ; then - # source the temporary /etc/default/nut.bak file - if [ -f /etc/default/nut.bak ] ; then - . /etc/default/nut.bak - - # FIXME: use a template (and debconf to output?) - echo "migrating /etc/default/nut to /etc/nut/nut.conf" - - # pre process the config - case "$START_UPSD" in - y|Y|yes|YES|Yes) - START_UPSD=yes - ;; - *) - START_UPSD=no - ;; - esac - case "$START_UPSMON" in - y|Y|yes|YES|Yes) - START_UPSMON=yes - ;; - *) - START_UPSMON=no - ;; - esac - - # now process the result - if [ "x$START_UPSD" = "xyes" ] ; then - if [ "x$START_UPSMON" = "xyes" ] ; then - # can also be netserver - NUT_MODE=standalone - #else not processed since it should be an error! - fi - else - if [ "x$START_UPSMON" = "xyes" ] ; then - NUT_MODE=netclient - else - NUT_MODE=none - fi - fi - - # output back the MODE to nut.conf - sed "s/^MODE\(.*\)/MODE=$NUT_MODE/" /etc/nut/nut.conf > /etc/nut/nut.conf.new - - # append the content of default, removing START_* / start... - grep -iv 'START' /etc/default/nut.bak >> /etc/nut/nut.conf.new - # move back to nut.conf - mv /etc/nut/nut.conf.new /etc/nut/nut.conf - # and to init.d/nut - #if [ -f /etc/init.d/nut ] ; then - # sed "s/^UPSD_OPTIONS\(.*\)/UPSD_OPTIONS=\"$UPSD_OPTIONS\"/" /etc/init.d/nut > /etc/init.d/nut.new - # sed "s/^UPSMON_OPTIONS\(.*\)/UPSMON_OPTIONS=\"$UPSMON_OPTIONS\"/" /etc/init.d/nut.new > /etc/init.d/nut - #fi - rm -f /etc/default/nut.bak /etc/default/nut - fi - else - # re process nut.conf MODE so that it can be sourced - NUT_MODE=`grep -e '^ *MODE' /etc/nut/nut.conf | tr -d " "` - sed "s/^ *MODE.*/$NUT_MODE/" /etc/nut/nut.conf > /etc/nut/nut.conf.new - mv /etc/nut/nut.conf.new /etc/nut/nut.conf - fi ;; abort-upgrade) diff --git a/debian/nut-server.preinst b/debian/nut-server.preinst index 587c150..72370d5 100644 --- a/debian/nut-server.preinst +++ b/debian/nut-server.preinst @@ -5,13 +5,6 @@ if [ "$1" = upgrade ]; then [ -f /etc/udev/rules.d/025_nut-usbups.rules ] && rm -f /etc/udev/rules.d/025_nut-usbups.rules [ -f /etc/udev/rules.d/52_nut-usbups.rules ] && rm -f /etc/udev/rules.d/52_nut-usbups.rules [ -f /etc/udev/rules.d/52-nut-usbups.rules ] && rm -f /etc/udev/rules.d/52-nut-usbups.rules - - # migrate /etc/default/nut to /etc/nut/nut.conf (part #1) - # we need to do this before default gets trashed - if [ -f /etc/default/nut ] ; then - # backup /etc/default/nut - cp /etc/default/nut /etc/default/nut.bak - fi fi #DEBHELPER# From 4090c200926b52d0322ed6d66614723d53fd99ea Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Fri, 10 Aug 2012 21:06:18 +0200 Subject: [PATCH 08/21] Fix changelog entry --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c569455..bb8be9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,7 +13,8 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Also create nut user when installing nut-client package and do not delete it on purge anymore (Closes: #682000) * Drop /etc/default/nut → /etc/nut/nut.conf migration code, migration - happends before squeeze release (Closes: #684392) + happends before squeeze release and this was against policy to have a + maintainer script modifying a conffile in the first place (Closes: #684392) -- Laurent Bigonville Thu, 09 Aug 2012 21:32:09 +0200 From 15f7f26bace9216ce97f478c510c6c3ba532e9d1 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 17:07:22 +0200 Subject: [PATCH 09/21] Add dependency against adduser and lsb-base on nut-client package --- debian/changelog | 3 ++- debian/control | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bb8be9b..b93c2a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,8 +15,9 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Drop /etc/default/nut → /etc/nut/nut.conf migration code, migration happends before squeeze release and this was against policy to have a maintainer script modifying a conffile in the first place (Closes: #684392) + * Add dependency against adduser and lsb-base on nut-client package - -- Laurent Bigonville Thu, 09 Aug 2012 21:32:09 +0200 + -- Laurent Bigonville Sat, 11 Aug 2012 17:06:27 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/control b/debian/control index 4bd6159..eac3480 100644 --- a/debian/control +++ b/debian/control @@ -57,7 +57,7 @@ Description: network UPS tools - core system Package: nut-client Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6) Provides: ups-monitor Conflicts: ups-monitor, nut-server (<< 2.6.3-1) Recommends: bash-completion From 062e200fee5334b50d6848c4cf4b853b800ac6cb Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 17:15:13 +0200 Subject: [PATCH 10/21] Fix typo in debian/nut-client.postinst --- debian/nut-client.postinst | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/nut-client.postinst b/debian/nut-client.postinst index fbcf657..9d5cad3 100644 --- a/debian/nut-client.postinst +++ b/debian/nut-client.postinst @@ -37,6 +37,7 @@ case "$1" in chown root:nut /var/run/nut chmod 770 /var/run/nut fi + ;; abort-upgrade) # do nothing From 00ffc53caa8dce9f101d12db9bdfa7f84a6af20c Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 17:21:01 +0200 Subject: [PATCH 11/21] Do not use dpkg-maintscript-helper to remove /etc/init.d/nut --- debian/changelog | 2 +- debian/control | 3 +-- debian/nut-server.maintscript | 3 --- debian/nut-server.postinst | 5 +++++ 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 debian/nut-server.maintscript diff --git a/debian/changelog b/debian/changelog index b93c2a9..15898a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,7 @@ nut (2.6.4-2) UNRELEASED; urgency=low * debian/rules: Stop the nut-client before nut-server on systems using static boot ordering (Closes: #679451) - * debian/nut-server.maintscript: Remove /etc/init.d/nut on upgrade + * debian/nut-server.postinst: Remove /etc/init.d/nut on upgrade (Closes: #677822) * Rename nut-server.lintian-overrides to nut-client.lintian-overrides and adjust overrides now that ups-monitor is shipped in nut-client package diff --git a/debian/control b/debian/control index eac3480..e5f9af3 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: admin Priority: optional Maintainer: Arnaud Quette Uploaders: Laurent Bigonville -Build-Depends: debhelper (>= 8.1.0~), +Build-Depends: debhelper (>= 8), cdbs (>= 0.4.90~), libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, @@ -43,7 +43,6 @@ Provides: nut-usb Conflicts: nut-hal-drivers, nut-usb (<< 2.1.0-3), nut-dev (<< 2.2.2) Replaces: nut (<< 2.6.1-2~) Breaks: nut (<< 2.6.1-2~) -Pre-Depends: ${misc:Pre-Depends} Description: network UPS tools - core system Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and diff --git a/debian/nut-server.maintscript b/debian/nut-server.maintscript deleted file mode 100644 index 1d202d4..0000000 --- a/debian/nut-server.maintscript +++ /dev/null @@ -1,3 +0,0 @@ -#Removing obsolete init script. -#The file is gone in 2.6.3-2 but was not removed on upgrades. -rm_conffile /etc/init.d/nut 2.6.4-3~ diff --git a/debian/nut-server.postinst b/debian/nut-server.postinst index c2574b8..7952552 100644 --- a/debian/nut-server.postinst +++ b/debian/nut-server.postinst @@ -49,6 +49,11 @@ case "$1" in && udevadm trigger --subsystem-match=usb --action=change # 557178 udevadm trigger --subsystem-match=usb + + if dpkg --compare-versions "$2" le "2.6.4-2~" ; then + rm -f /etc/init.d/nut + update-rc.d nut remove >/dev/null + fi ;; abort-upgrade) From 48b40bb27f5eafcae8cd655e29f747f672b07ee2 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 17:26:54 +0200 Subject: [PATCH 12/21] debian/gbp.conf: Switch to wheezy branches --- debian/gbp.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/gbp.conf b/debian/gbp.conf index 6837223..d91ad90 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,6 +1,6 @@ [DEFAULT] -debian-branch = debian -upstream-branch = upstream +debian-branch = debian-wheezy +upstream-branch = upstream-wheezy pristine-tar = True [git-buildpackage] From 4ef77d11071e2a2acf118caa57f3558c1f359d0a Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 18:04:03 +0200 Subject: [PATCH 13/21] Be sure that client is stopped before the server also when using dependencies based boot --- debian/changelog | 4 +++- debian/nut-server.init | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 15898a4..7426f0b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,8 +16,10 @@ nut (2.6.4-2) UNRELEASED; urgency=low happends before squeeze release and this was against policy to have a maintainer script modifying a conffile in the first place (Closes: #684392) * Add dependency against adduser and lsb-base on nut-client package + * Be sure that client is stopped before the server also when using + dependencies based boot - -- Laurent Bigonville Sat, 11 Aug 2012 17:06:27 +0200 + -- Laurent Bigonville Sat, 11 Aug 2012 18:02:59 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/nut-server.init b/debian/nut-server.init index 5505be4..a606b72 100644 --- a/debian/nut-server.init +++ b/debian/nut-server.init @@ -2,7 +2,7 @@ ### BEGIN INIT INFO # Provides: nut-server upsd # Required-Start: $local_fs $syslog $network $remote_fs udev -# Required-Stop: $local_fs $syslog $network $remote_fs udev nut-client +# Required-Stop: $local_fs $syslog $network $remote_fs udev # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Network UPS Tools initscript From 474ba384e9790d9ffd67a6b12d1ecdb502312e59 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 19:36:11 +0200 Subject: [PATCH 14/21] Fix package descriptions (Closes: #678068) --- debian/changelog | 3 ++- debian/control | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7426f0b..3af2886 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,8 +18,9 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Add dependency against adduser and lsb-base on nut-client package * Be sure that client is stopped before the server also when using dependencies based boot + * Fix package descriptions (Closes: #678068) - -- Laurent Bigonville Sat, 11 Aug 2012 18:02:59 +0200 + -- Laurent Bigonville Sat, 11 Aug 2012 19:35:49 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/control b/debian/control index e5f9af3..e3db9c0 100644 --- a/debian/control +++ b/debian/control @@ -33,7 +33,8 @@ 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 install both nut-server and nut-client, + in most cases it is sufficient for a basic UPS monitoring system. Package: nut-server Architecture: any @@ -51,8 +52,7 @@ Description: network UPS tools - core system changes. . This package provides NUT's core system, and the serial and USB UPS - drivers. In most cases it is sufficient for a basic UPS monitoring - system. + drivers. Package: nut-client Architecture: any From 912696f8a78cd091ab663e91babebcb27dc6987a Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 20:04:57 +0200 Subject: [PATCH 15/21] Also install /bin/upssched-cmd in nut-client package as this script is referenced in default upssched.conf config file --- debian/changelog | 4 +++- debian/nut-client.install | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3af2886..c6fb1c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,8 +19,10 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Be sure that client is stopped before the server also when using dependencies based boot * Fix package descriptions (Closes: #678068) + * Also install /bin/upssched-cmd in nut-client package as this script is + referenced in default upssched.conf config file - -- Laurent Bigonville Sat, 11 Aug 2012 19:35:49 +0200 + -- Laurent Bigonville Sat, 11 Aug 2012 20:03:56 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/nut-client.install b/debian/nut-client.install index cde4bd7..b4b7d7f 100644 --- a/debian/nut-client.install +++ b/debian/nut-client.install @@ -4,6 +4,7 @@ debian/tmp/bin/upsrw debian/tmp/bin/upscmd debian/tmp/sbin/upsmon debian/tmp/sbin/upssched +debian/tmp/bin/upssched-cmd debian/tmp/etc/bash_completion.d/nut debian/tmp/etc/nut/nut.conf debian/tmp/etc/nut/upsmon.conf From edbf4928c52a9deecf17d7f8c7f0fff244498868 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sat, 11 Aug 2012 21:02:26 +0200 Subject: [PATCH 16/21] debian/watch: Update watch file --- debian/changelog | 3 ++- debian/watch | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c6fb1c7..14b4693 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,8 +21,9 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Fix package descriptions (Closes: #678068) * Also install /bin/upssched-cmd in nut-client package as this script is referenced in default upssched.conf config file + * debian/watch: Update watch file - -- Laurent Bigonville Sat, 11 Aug 2012 20:03:56 +0200 + -- Laurent Bigonville Sat, 11 Aug 2012 21:02:05 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/watch b/debian/watch index cfb143e..fd44637 100644 --- a/debian/watch +++ b/debian/watch @@ -1,2 +1,2 @@ version=3 -http://www.networkupstools.org/source/2.4/nut-(.*)\.tar\.gz debian uupdate +http://www.networkupstools.org/source/([0-9.]+)/nut-(.*)\.tar\.gz From ba9e479229b41f9dc7decb320c7759e93cb29967 Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sun, 12 Aug 2012 00:08:16 +0200 Subject: [PATCH 17/21] Be sure that all maintainer scripts are returning 0 at their end --- debian/changelog | 3 ++- debian/nut-cgi.postrm | 1 + debian/nut-client.postinst | 2 ++ debian/nut-server.postinst | 2 ++ debian/nut-server.postrm | 1 + debian/nut-server.preinst | 2 ++ 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 14b4693..8605dda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,8 +22,9 @@ nut (2.6.4-2) UNRELEASED; urgency=low * Also install /bin/upssched-cmd in nut-client package as this script is referenced in default upssched.conf config file * debian/watch: Update watch file + * Be sure that all maintainer scripts are returning 0 at their end - -- Laurent Bigonville Sat, 11 Aug 2012 21:02:05 +0200 + -- Laurent Bigonville Sun, 12 Aug 2012 00:07:46 +0200 nut (2.6.4-1) unstable; urgency=high diff --git a/debian/nut-cgi.postrm b/debian/nut-cgi.postrm index bdfecf0..91be66d 100644 --- a/debian/nut-cgi.postrm +++ b/debian/nut-cgi.postrm @@ -44,3 +44,4 @@ esac #DEBHELPER# +exit 0 diff --git a/debian/nut-client.postinst b/debian/nut-client.postinst index 9d5cad3..8546a95 100644 --- a/debian/nut-client.postinst +++ b/debian/nut-client.postinst @@ -59,3 +59,5 @@ case "$1" in esac #DEBHELPER# + +exit 0 diff --git a/debian/nut-server.postinst b/debian/nut-server.postinst index 7952552..d0ec14b 100644 --- a/debian/nut-server.postinst +++ b/debian/nut-server.postinst @@ -76,3 +76,5 @@ case "$1" in esac #DEBHELPER# + +exit 0 diff --git a/debian/nut-server.postrm b/debian/nut-server.postrm index 1ca0437..b95b26f 100644 --- a/debian/nut-server.postrm +++ b/debian/nut-server.postrm @@ -47,3 +47,4 @@ esac #DEBHELPER# +exit 0 diff --git a/debian/nut-server.preinst b/debian/nut-server.preinst index 72370d5..f3e949f 100644 --- a/debian/nut-server.preinst +++ b/debian/nut-server.preinst @@ -8,3 +8,5 @@ if [ "$1" = upgrade ]; then fi #DEBHELPER# + +exit 0 From d1870abc9453ed626fb053e2d0323a48b61ed81e Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Sun, 12 Aug 2012 20:39:01 +0200 Subject: [PATCH 18/21] Release to unstable (2.6.4-2) --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8605dda..a603e8c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -nut (2.6.4-2) UNRELEASED; urgency=low +nut (2.6.4-2) unstable; urgency=low * debian/rules: Stop the nut-client before nut-server on systems using static boot ordering (Closes: #679451) @@ -24,7 +24,7 @@ nut (2.6.4-2) UNRELEASED; urgency=low * debian/watch: Update watch file * Be sure that all maintainer scripts are returning 0 at their end - -- Laurent Bigonville Sun, 12 Aug 2012 00:07:46 +0200 + -- Laurent Bigonville Sun, 12 Aug 2012 20:38:52 +0200 nut (2.6.4-1) unstable; urgency=high From 6bfb45a6bc019c1124fd3644af453597d76e0ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 27 Nov 2012 08:34:19 +0100 Subject: [PATCH 19/21] Debian release 2.6.4-2.1 --- debian/changelog | 8 ++++++++ debian/nut-client.preinst | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 debian/nut-client.preinst diff --git a/debian/changelog b/debian/changelog index a603e8c..88b850b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +nut (2.6.4-2.1) unstable; urgency=low + + * Non-maintainer upload. + * debian/nut-client.preinst: revert /etc/nut/nut.conf mangling done by older + versions of the postinst (Closes: #677054) + + -- Sébastien Villemot Mon, 26 Nov 2012 21:09:33 +0100 + nut (2.6.4-2) unstable; urgency=low * debian/rules: Stop the nut-client before nut-server on systems using static diff --git a/debian/nut-client.preinst b/debian/nut-client.preinst new file mode 100644 index 0000000..2107da1 --- /dev/null +++ b/debian/nut-client.preinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +# Revert /etc/nut/nut.conf mangling done by older versions of the postinst +# See #677054 +if [ "$1" = "install" -o "$1" = "upgrade" ] \ + && dpkg --compare-versions "$2" lt "2.6.4-2" \ + && [ -f /etc/nut/nut.conf ] \ + && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = f9b571ae65952e3a761fac2202633478 ]; then + sed -i 's/^MODE=none$/MODE = none/' /etc/nut/nut.conf +fi + +#DEBHELPER# From d8a36de1df036ef621c78d9753afaf5790b9e515 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Thu, 20 Dec 2012 20:40:01 +0100 Subject: [PATCH 20/21] Imported Debian patch 2.6.4-2.2 --- debian/changelog | 13 +++++++++++++ debian/control | 2 +- debian/nut-client.postinst | 29 +++++++++++++++++++++-------- debian/nut-server.postinst | 28 ++++++++++++++++++---------- 4 files changed, 53 insertions(+), 19 deletions(-) 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 ;; From 440624271f734ef498809db10ae7896cd61d5b42 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Sat, 26 Jan 2013 20:09:48 +0100 Subject: [PATCH 21/21] Imported Debian patch 2.6.4-2.3 --- debian/changelog | 9 +++++++++ debian/nut-client.preinst | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/debian/changelog b/debian/changelog index b320316..e7b612b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +nut (2.6.4-2.3) unstable; urgency=low + + * Non-maintainer upload with fixes for wheezy. + * debian/nut-client.preinst: also revert /etc/nut/nut.conf mangling done + by postinst during upgrade from lenny to squeeze (Really closes: #677054) + Thanks to Andreas Beckmann for the review. + + -- Ivo De Decker Sat, 26 Jan 2013 20:09:48 +0100 + nut (2.6.4-2.2) unstable; urgency=low * Non-maintainer upload with fixes for wheezy. diff --git a/debian/nut-client.preinst b/debian/nut-client.preinst index 2107da1..53134e3 100644 --- a/debian/nut-client.preinst +++ b/debian/nut-client.preinst @@ -4,6 +4,15 @@ set -e # Revert /etc/nut/nut.conf mangling done by older versions of the postinst # See #677054 +# changed configfile created by a fresh install in lenny, upgraded to squeeze +if [ "$1" = "install" -o "$1" = "upgrade" ] \ + && dpkg --compare-versions "$2" lt "2.6.4-2" \ + && [ -f /etc/nut/nut.conf ] \ + && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = 331cca39153f451c2968f4b734c1cf3f ]; then + sed -i '29,$ d' /etc/nut/nut.conf +fi + +# changed configfile created by a fresh install in squeeze if [ "$1" = "install" -o "$1" = "upgrade" ] \ && dpkg --compare-versions "$2" lt "2.6.4-2" \ && [ -f /etc/nut/nut.conf ] \