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

View file

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