Compare commits

...

21 commits

Author SHA1 Message Date
Ivo De Decker
440624271f Imported Debian patch 2.6.4-2.3 2013-01-27 00:25:46 +01:00
Ivo De Decker
d8a36de1df Imported Debian patch 2.6.4-2.2 2012-12-23 22:49:27 +01:00
Sébastien Villemot
6bfb45a6bc Debian release 2.6.4-2.1 2012-11-27 08:34:19 +01:00
Laurent Bigonville
d1870abc94 Release to unstable (2.6.4-2) 2012-08-12 20:39:01 +02:00
Laurent Bigonville
ba9e479229 Be sure that all maintainer scripts are returning 0 at their end 2012-08-12 20:36:23 +02:00
Laurent Bigonville
edbf4928c5 debian/watch: Update watch file 2012-08-12 20:36:23 +02:00
Laurent Bigonville
912696f8a7 Also install /bin/upssched-cmd in nut-client package as this script is referenced in default upssched.conf config file 2012-08-12 20:36:23 +02:00
Laurent Bigonville
474ba384e9 Fix package descriptions (Closes: #678068) 2012-08-12 20:36:23 +02:00
Laurent Bigonville
4ef77d1107 Be sure that client is stopped before the server also when using dependencies based boot 2012-08-12 20:36:23 +02:00
Laurent Bigonville
48b40bb27f debian/gbp.conf: Switch to wheezy branches 2012-08-12 20:36:23 +02:00
Laurent Bigonville
00ffc53caa Do not use dpkg-maintscript-helper to remove /etc/init.d/nut 2012-08-12 20:36:23 +02:00
Laurent Bigonville
062e200fee Fix typo in debian/nut-client.postinst 2012-08-11 17:15:13 +02:00
Laurent Bigonville
15f7f26bac Add dependency against adduser and lsb-base on nut-client package 2012-08-11 17:07:22 +02:00
Laurent Bigonville
4090c20092 Fix changelog entry 2012-08-10 21:06:18 +02:00
Laurent Bigonville
a5828413ec Drop /etc/default/nut → /etc/nut/nut.conf migration code, migration happends before squeeze release (Closes: #684392) 2012-08-10 21:05:26 +02:00
Laurent Bigonville
b7d91288c6 Also create nut user when installing nut-client package and do not delete it on purge anymore (Closes: #682000) 2012-08-10 21:05:26 +02:00
Laurent Bigonville
8a901d6ac1 Move nut metapackage to Section: metapackages 2012-08-10 21:05:26 +02:00
Laurent Bigonville
07ab571061 Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched regression (Taken from upstream) (Closes: #679513) 2012-08-10 21:05:26 +02:00
Laurent Bigonville
e038ffaf38 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) 2012-08-10 21:05:26 +02:00
Laurent Bigonville
080f7baf14 debian/nut-server.maintscript: Remove /etc/init.d/nut on upgrade (Closes: #677822) 2012-08-10 21:05:26 +02:00
Laurent Bigonville
4f4f1f9119 debian/rules: Stop the nut-client before nut-server on systems using static boot ordering (Closes: #679451) 2012-08-10 21:05:24 +02:00
17 changed files with 209 additions and 92 deletions

58
debian/changelog vendored
View file

@ -1,3 +1,61 @@
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 <ivo.dedecker@ugent.be> Sat, 26 Jan 2013 20:09:48 +0100
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 <ivo.dedecker@ugent.be> Thu, 20 Dec 2012 20:40:01 +0100
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 <sebastien@debian.org> 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
boot ordering (Closes: #679451)
* 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
(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
* 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 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
* 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
* Be sure that all maintainer scripts are returning 0 at their end
-- Laurent Bigonville <bigon@debian.org> Sun, 12 Aug 2012 20:38:52 +0200
nut (2.6.4-1) unstable; urgency=high
* New upstream release (Closes: #671444)

9
debian/control vendored
View file

@ -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
@ -32,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 installs both nut-server and nut-client,
in most cases it is sufficient for a basic UPS monitoring system.
Package: nut-server
Architecture: any
@ -50,12 +52,11 @@ 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
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

4
debian/gbp.conf vendored
View file

@ -1,6 +1,6 @@
[DEFAULT]
debian-branch = debian
upstream-branch = upstream
debian-branch = debian-wheezy
upstream-branch = upstream-wheezy
pristine-tar = True
[git-buildpackage]

View file

@ -44,3 +44,4 @@ esac
#DEBHELPER#
exit 0

View file

@ -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

1
debian/nut-client.lintian-overrides vendored Normal file
View file

@ -0,0 +1 @@
nut-client: script-in-etc-init.d-not-registered-via-update-rc.d

76
debian/nut-client.postinst vendored Normal file
View file

@ -0,0 +1,76 @@
#!/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
# on first install
if [ -z "$2" ] ; then
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
fi
# 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
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)
# do nothing
;;
abort-remove)
# do nothing
;;
abort-deconfigure)
# do nothing
;;
*)
echo "$0: incorrect arguments: $*" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

23
debian/nut-client.preinst vendored Normal file
View file

@ -0,0 +1,23 @@
#!/bin/sh
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 ] \
&& [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = f9b571ae65952e3a761fac2202633478 ]; then
sed -i 's/^MODE=none$/MODE = none/' /etc/nut/nut.conf
fi
#DEBHELPER#

View file

@ -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

View file

@ -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

View file

@ -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 ups.conf upsd.conf upsmon.conf upsd.users 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 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,67 +53,14 @@ case "$1" in
# 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
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
if [ "x$START_UPSMON" = "xyes" ] ; then
NUT_MODE=netclient
else
NUT_MODE=none
fi
mv /etc/init.d/nut /etc/init.d/nut.dpkg-old
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
update-rc.d nut remove >/dev/null
fi
;;
@ -134,3 +84,5 @@ case "$1" in
esac
#DEBHELPER#
exit 0

View file

@ -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
;;
@ -53,3 +47,4 @@ esac
#DEBHELPER#
exit 0

View file

@ -5,13 +5,8 @@ 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#
exit 0

View file

@ -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) */

View file

@ -1 +1,2 @@
0001-fix-upsmon-regression.patch
0002-nut-monitor-paths.patch

4
debian/rules vendored
View file

@ -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))

2
debian/watch vendored
View file

@ -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