[Nut-upsuser] The system doesn't shutdown

Roger Price
Thu, 29 Oct 2015 11:58:01 -0000

On Wed, 28 Oct 2015, George Anchev wrote:

> ?${sbinPath}upsmon -c fsd
> In 'upsmon --help' I read: "- fsd: shutdown all master UPSes
(use with
> caution)". What exactly does this line do?

My understanding is that it calls upsmon running as root to execute the
command specified by SHUTDOWNCMD in upsmon.conf, and that it checks that
it is running as root.

> I decided to make a simple test with this script named test:
>
> #!/bin/bash
> MSG0=$'test'
> echo $MSG0 | /usr/bin/wall
> echo "abc"
>
> If I run it as root, there is a notification - both in console and in
> KDE and "abc" in console. But if I attempt to run the test script
it as
> upsd:
> su - upsd -c "./test"
> the result is only silence.

Its upsmon which executes the shutdown command, not upsd.  upsmon only
accepts the -c values it understands, and will remind you of this if you
try something else.

I don't know if upsmon is running as root or upsd when it calls wall for a
shutdown.  If it is running as upsd then there could be a problem.

Roger