[Nut-upsuser] UPS does not want to power off itself

Arjen de Korte nut+users at de-korte.org
Fri Jun 19 07:34:41 UTC 2009


Citeren "Anton E. Panchenko" <pae op 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




More information about the Nut-upsuser mailing list