Package: nut
Version: 2.0.5-3
Severity: wishlist
Tags: patch
The attached patch incorporates the ability to set option flags for
upsd in /etc/default/nut which are then used in /etc/init.d/nut when
starting upsd. In particular, I've used it to bind upsd to the local
network interface instead of all interfaces, which I think should be
considered for use as the default.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.18-4-686 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages nut depends on:
ii adduser 3.102 Add and remove users and groups
ii debconf [debconf-2.0] 1.5.13 Debian configuration management sy
ii libc6 2.5-2 GNU C Library: Shared libraries
ii lsb-base 3.1-23.1 Linux Standard Base 3.1 init scrip
nut recommends no packages.
-- debconf information:
nut/major_conf_changes:
nut/2_0_upstream_changes:
nut/change_system_user:
nut/major_upstream_changes:
nut/remove_debian_conf:
diff -urN etc.orig/default/nut etc/default/nut
--- etc.orig/default/nut 2007-04-19 09:47:27.000000000 -0400
+++ etc/default/nut 2007-04-19 09:46:39.000000000 -0400
@@ -6,6 +6,10 @@
#START_UPSMON=no
START_UPSMON=yes
+# upsd options
+# "-i 127.0.0.1" will bind to the local interface
+upsd_opts="-i 127.0.0.1"
+
# At the end of an emergency system halt, the upsmon master will signal the
# UPS to switch off. This may fail for any number of reasons, however, most
# notably if line power returns during the shutdown process. (See the
diff -urN etc.orig/init.d/nut etc/init.d/nut
--- etc.orig/init.d/nut 2007-04-19 09:47:42.000000000 -0400
+++ etc/init.d/nut 2007-04-19 09:46:48.000000000 -0400
@@ -43,7 +43,8 @@
start)
! /sbin/upsdrvctl start >/dev/null 2>&1 && \
log_progress_msg "(upsdrvctl failed)" || log_progress_msg
"upsdrvctl"
- start-stop-daemon -S -q -p $upsd_pid -x $upsd >/dev/null 2>&1
+ start-stop-daemon -S -q -p $upsd_pid -x $upsd \
+ -- $upsd_opts >/dev/null 2>&1
;;
stop)
start-stop-daemon -K -o -q -p $upsd_pid -n upsd >/dev/null 2>&1