From 112d9a7c99cfe815b0e281b10d471550e0b21acb Mon Sep 17 00:00:00 2001 From: Arnaud Quette Date: Mon, 4 Jun 2012 11:38:04 +0200 Subject: [PATCH] Fix nut-client init script (Closes: #675619) Fix action "start" and use of log_*_*msg LSB log functions. Patch from Laurent Bigonville (Closes: #675619) --- debian/changelog | 2 ++ debian/nut-client.init | 30 ++++++++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index ed29e52..3a66c0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ nut (2.6.4-1) UNRELEASED; urgency=low * New upstream release (Closes: #671444) * acknowledges NMU (Closes: #613643) + * debian/nut-client.init: fix action "start" and use of log_*_*msg + LSB log functions (Closes: #675619) -- Arnaud Quette Fri, 01 Jun 2012 16:15:20 +0200 diff --git a/debian/nut-client.init b/debian/nut-client.init index ade3ffe..8524dd2 100755 --- a/debian/nut-client.init +++ b/debian/nut-client.init @@ -78,8 +78,8 @@ start_stop_client () { -- $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 @@ start_stop_client () { 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 @@ case "$1" in # - 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)