[Nut-upsuser] ubuntu 8.04 upssched CANCEL-TIMER ignored
Herwarth Heitmann
herwarth at heitmann.nl
Mon Dec 15 12:07:47 UTC 2008
hello,
every two weeks my system shutsdown because my apc ups does a self
test and nut is not picking up the cancel timer event.
according to me all settings are correct. in my upssched-cmd script i
execute a remote shutdown, because nut is running in a virtual machine
and i want the script to shutdown all hosts in my esx environment.
my upssched-cmd script
----
#!/bin/sh
# !! COPY THIS FILE TO /USR/SBIN/UPSSCHED-CMD !!
LOGGER=/usr/bin/logger
WALL=/usr/bin/wall
UPSMON=/sbin/upsmon
case $1 in
onbatt)
$LOGGER -t upssched-cmd "The UPS has been on battery for awhile"
echo "The UPS has been on battery for a while, logout right now!" |
$WALL
;;
shutdown)
$LOGGER -t upssched-cmd "UPS on battery too long, shutdown
all virtual machines on ESX host"
# /usr/bin/ssh root at 192.168.1.2 '/usr/bin/nohup /root/shutdown.sh > /
root/shutdown.log &' &
;;
offbatt)
$LOGGER -t upssched-cmd "The UPS is online again"
echo "The UPS is online again" | $WALL
;;
*)
$LOGGER -t upssched-cmd "ERROR!! $0 doesn't support $1"
;;
esac
-----
my upssched.conf
-----
CMDSCRIPT /usr/sbin/upssched-cmd
LOCKFN /var/lib/nut/upssched.lock
PIPEFN /var/lib/nut/upssched.pipe
AT ONBATT * START-TIMER shutdown 90
AT ONLINE * CANCEL-TIMER shutdown offbatt
----
my logfile daemon.log:
Dec 15 13:01:43 helux-ups upsmon[5366]: UPS apc at localhost on battery
Dec 15 13:01:43 helux-ups upssched[5385]: Timer daemon started
Dec 15 13:01:44 helux-ups upssched[5385]: New timer: shutdown (90
seconds)
Dec 15 13:01:48 helux-ups upsmon[5366]: UPS apc at localhost on line power
Dec 15 13:03:14 helux-ups upssched[5385]: Event: shutdown
Dec 15 13:03:29 helux-ups upssched[5385]: Timer queue empty, exiting
----
so the timer is never cancelled.....
please help
More information about the Nut-upsuser
mailing list