Fix nut-client init script (Closes: #675619)

Fix action "start" and use of log_*_*msg LSB log functions.
Patch from Laurent Bigonville (Closes: #675619)
This commit is contained in:
Arnaud Quette 2012-06-04 11:38:04 +02:00
parent 848fe6dc74
commit 112d9a7c99
2 changed files with 16 additions and 16 deletions

2
debian/changelog vendored
View file

@ -2,6 +2,8 @@ nut (2.6.4-1) UNRELEASED; urgency=low
* New upstream release (Closes: #671444) * New upstream release (Closes: #671444)
* acknowledges NMU (Closes: #613643) * acknowledges NMU (Closes: #613643)
* debian/nut-client.init: fix action "start" and use of log_*_*msg
LSB log functions (Closes: #675619)
-- Arnaud Quette <aquette@debian.org> Fri, 01 Jun 2012 16:15:20 +0200 -- Arnaud Quette <aquette@debian.org> Fri, 01 Jun 2012 16:15:20 +0200

View file

@ -78,8 +78,8 @@ start_stop_client () {
-- $UPSMON_OPTIONS >/dev/null 2>&1 && return 0 || return 1 -- $UPSMON_OPTIONS >/dev/null 2>&1 && return 0 || return 1
;; ;;
stop) stop)
start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1 && start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1 \
log_progress_msg "upsmon" || log_progress_msg "(upsmon failed)" && return 0 || return 1
;; ;;
esac esac
;; ;;
@ -92,23 +92,22 @@ start_stop_client () {
case "$1" in case "$1" in
start) start)
log_daemon_msg "Starting $DESC" log_daemon_msg "Starting $DESC" "$NAME"
check_var_directory check_var_directory
start_stop_client start && log_progress_msg "upsmon" start_stop_client start
|| log_progress_msg "upsmon (failed)" log_end_msg $?
log_end_msg 0
;; ;;
stop) stop)
log_daemon_msg "Stopping $DESC" log_daemon_msg "Stopping $DESC" "$NAME"
start_stop_client stop && log_progress_msg "upsmon" start_stop_client stop
|| log_progress_msg "upsmon (failed)" log_end_msg $?
log_end_msg 0
;; ;;
reload) reload)
log_daemon_msg "Reloading $DESC" log_daemon_msg "Reloading $DESC" "$NAME"
$upsmon -c reload >/dev/null 2>&1 $upsmon -c reload >/dev/null 2>&1
log_end_msg $?
;; ;;
restart|force-reload) restart|force-reload)
@ -118,15 +117,14 @@ case "$1" in
# - stop nut-client # - stop nut-client
# - restart (Ie stop+start) nut-server # - restart (Ie stop+start) nut-server
# - start nut-client # - start nut-client
log_daemon_msg "Restarting $DESC" log_daemon_msg "Restarting $DESC" "$NAME"
start_stop_client stop || log_progress_msg "upsmon (failed)" start_stop_client stop || true
# should then 'start_stop_server stop', Ie /etc/init.d/nut-server stop # should then 'start_stop_server stop', Ie /etc/init.d/nut-server stop
#sleep 5 #sleep 5
check_var_directory check_var_directory
# should first 'start_stop_server start', Ie /etc/init.d/nut-server start # should first 'start_stop_server start', Ie /etc/init.d/nut-server start
start_stop_client start && log_progress_msg "upsmon" start_stop_client start
|| log_progress_msg "upsmon (failed)" log_end_msg $?
log_end_msg 0
;; ;;
status) status)