[Nut-upsuser] upssched. Again.

Ciprian Marius Vizitiu cvizitiu at gbif.org
Sun Jun 24 18:08:04 UTC 2007


Hi everyone, 
 
Here I am with my second attempt to persuade upssched to do things; for some
reasons it just won't! Or if it runs, it never runs the script.

OK, the story first: 2.0.3 (conveniently comes as RPMs by default on FC6)
running on FC6; APC Smart-UPS 750 via serial connection all working fine.
Here are the main files:
 
/etc/sysconfig/ups

SERVER=yes
MODEL=apcsmart
DEVICE=/dev/ttyS0
OPTIONS=


/etc/ups/ups.conf

[APC750]
        driver = apcsmart
        port = /dev/ttyS0
#       cable = 1234
        desc = "Smart-UPS 750"


/etc/ups/upsd.conf

ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32

ACCEPT localhost
REJECT all


/etc/ups/upssched.conf

CMDSCRIPT /usr/sbin/upssched-cmd
PIPEFN /var/run/upssched/upssched.pipe
LOCKFN /var/run/upssched/upssched.lock

#AT ONBATT APC750 at localhost START-TIMER onbattwarn 60

AT ONBATT APC750 at localhost EXCUTE onbattwarn

#AT ONLINE APC750 at localhost CANCEL-TIMER onbattwarn


/usr/sbin/upssched-cmd

#!/bin/sh
echo "Booo" > /tmp/upstest
/usr/bin/logger -t upssched-cmd "The UPS has been gone for awhile"


# ls -la /etc/ups/
total 48
drwxr-xr-x   2 root root  4096 Jun 24 19:47 ./
drwxr-xr-x 102 root root 12288 Jun 24 18:40 ../
-rw-r-----   1 root nut   3665 Jun 24 18:34 ups.conf
-rw-r-----   1 root nut   1364 Jul 12  2006 upsd.conf
-rw-r-----   1 root nut   2327 Jun 24 18:45 upsd.users
-rw-r-----   1 root nut  11312 Jun 24 18:45 upsmon.conf
-rw-r-----   1 root nut   4037 Jun 24 19:21 upssched.conf

# ls -la /var/run/upssched/
total 12
drwx------  2 nut  nut  4096 Jun 24 18:53 ./
drwxr-xr-x 21 root root 4096 Jun 24 18:53 ../

# ls -la /usr/sbin/upssched-cmd
-rwxr-xr-x 1 root root 627 Jun 24 19:07 /usr/sbin/upssched-cmd*

To my mind this "should work!"(TM), upssched should run the script when I
unplug the UPS. Yet it doesn't... I get the wall and the log messages for
the event but I never get to see the message "The UPS has been gone for
awhile" in the logs or the file created in /tmp. Oh and if I uncomment the
START-TIMER lines nothing shows up in "/var/run/upssched/"... Shouldn't it
be at least the LOCKFN during the timer period?

Any hints? :-(





More information about the Nut-upsuser mailing list