Package: nut-client
Followup-For: Bug #675619
Hi (again),
Here please find a patch attached.
The only missing thing is that the init script should return OK when
invoking the start action if the daemon is already running.
Cheers
Laurent Bigonville
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_BE.utf8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages nut-client depends on:
ii libc6 2.13-32
ii libupsclient1 2.6.3-2
Versions of packages nut-client recommends:
ii bash-completion 1:1.99-3
nut-client suggests no packages.
-- Configuration Files:
/etc/init.d/nut-client changed [not included]
/etc/nut/nut.conf changed [not included]
/etc/nut/upsmon.conf [Errno 13] Permission non accordée: u'/etc/nut/upsmon.conf'
/etc/nut/upssched.conf [Errno 13] Permission non accordée:
u'/etc/nut/upssched.conf'
-- no debconf information
--- /tmp/nut-2.6.3/debian/nut-client.init 2012-05-02 22:29:43.000000000 +0200
+++ /etc/init.d/nut-client 2012-06-02 16:45:04.033763419 +0200
@@ -78,8 +78,8 @@
-- $UPSMON_OPTIONS >/dev/null 2>&1 && return 0 || return 1
;;
stop)
- start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1 &&
- log_progress_msg "upsmon" || log_progress_msg "(upsmon failed)"
+ start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1 \
+ && return 0 || return 1
;;
esac
;;
@@ -92,23 +92,22 @@
case "$1" in
start)
- log_daemon_msg "Starting $DESC"
+ log_daemon_msg "Starting $DESC" "$NAME"
check_var_directory
- start_stop_client start && log_progress_msg "upsmon"
- || log_progress_msg "upsmon (failed)"
- log_end_msg 0
+ start_stop_client start
+ log_end_msg $?
;;
stop)
- log_daemon_msg "Stopping $DESC"
- start_stop_client stop && log_progress_msg "upsmon"
- || log_progress_msg "upsmon (failed)"
- log_end_msg 0
+ log_daemon_msg "Stopping $DESC" "$NAME"
+ start_stop_client stop
+ log_end_msg $?
;;
reload)
- log_daemon_msg "Reloading $DESC"
+ log_daemon_msg "Reloading $DESC" "$NAME"
$upsmon -c reload >/dev/null 2>&1
+ log_end_msg $?
;;
restart|force-reload)
@@ -118,15 +117,14 @@
# - stop nut-client
# - restart (Ie stop+start) nut-server
# - start nut-client
- log_daemon_msg "Restarting $DESC"
- start_stop_client stop || log_progress_msg "upsmon (failed)"
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ start_stop_client stop || true
# should then 'start_stop_server stop', Ie /etc/init.d/nut-server stop
#sleep 5
check_var_directory
# should first 'start_stop_server start', Ie /etc/init.d/nut-server start
- start_stop_client start && log_progress_msg "upsmon"
- || log_progress_msg "upsmon (failed)"
- log_end_msg 0
+ start_stop_client start
+ log_end_msg $?
;;
status)