Citeren "Anton E. Panchenko" <p...@chernigovka.org>:

[...]

upsshed-cmd
#!/bin/sh
MSG="The UPS is running on battery about 2 minutes, doing force shutdown"

case $1 in
   fsd)
       logger -t upssched-cmd $MSG
       /sbin/upsmon -c fsd
       ;;
   *)
       logger -t upssched-cmd "ERROR!! $0 Unrecognized command: $1"
   ;;
esac

Assuming the message is logged (and you thereby having confirmed that indeed the 'fsd' timer is elapsed, the problem is that upssched will run with the same UID as upsmon (that started this timer). In that case, the command

    /sbin/upsmon -c fsd

will also run as this user. So in order to test this, you must make sure that the above command when running as a non-privileged user will shutdown your system or you must run upsmon as a privileged user. You might be able to do something similar by allowing this user to use 'sudo' for just this command. Choose your poison.

Best regards, Arjen
--
Please keep list traffic on the list


_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to