DNS-323 with Alt-F and nut enabled - Not shutting down as slave

240 views
Skip to first unread message

SSDguy801

unread,
Mar 31, 2021, 8:11:09 PM3/31/21
to Alt-F
Hello friends,

I'm trying to troubleshoot why upsmon is not shutting down my DNS-323 w/ Alt-F and nut installed. 

I am connecting to the master (which is a Linux Open Media Vault distro):

DNS-323 (slave):

[root@NAS02]# rcnut stop

Stopping upsmon: OK.

[root@NAS02]# rcnut start; echo $?

Starting upsmon: Network UPS Tools upsmon 2.6.1

UPS: up...@192.168.10.50 (slave) (power value 1)

Using power down flag file /etc/killpower

OK.

0

[root@UOSRLC-NAS02]#


In my upsmon.conf I found the original shutdown command was: 

SHUTDOWNCMD "/sbin/shutdown -h +0"

...Where (since /sbin/shutdown bin does not exist in Alt-F) I tried changing it to:

SHUTDOWNCMD "/usr/sbin/poweroff -f" 

...But that still does not shut it down.


What am I missing here or how can I troubleshoot this further?


THANKS

OJ

Joao Cardoso

unread,
Mar 31, 2021, 9:31:24 PM3/31/21
to Alt-F
On Thursday, April 1, 2021 at 1:11:09 AM UTC+1 SSDguy801 wrote:
Hello friends,

I'm trying to troubleshoot why upsmon is not shutting down my DNS-323 w/ Alt-F and nut installed. 

I am connecting to the master (which is a Linux Open Media Vault distro):

DNS-323 (slave):

[root@NAS02]# rcnut stop

Stopping upsmon: OK.

[root@NAS02]# rcnut start; echo $?

Starting upsmon: Network UPS Tools upsmon 2.6.1

UPS: up...@192.168.10.50 (slave) (power value 1)

Using power down flag file /etc/killpower

OK.

0

[root@UOSRLC-NAS02]#


In my upsmon.conf I found the original shutdown command was: 

SHUTDOWNCMD "/sbin/shutdown -h +0"

...Where (since /sbin/shutdown bin does not exist in Alt-F) I tried changing it to:

SHUTDOWNCMD "/usr/sbin/poweroff -f" 


Don't use '-f', you want a clean poweroff, which is done through the rcE init script (/etc/init.d/rcE)

...But that still does not shut it down.

Doesn't a plain 'poweroff' from the command line (or /usr/sbin/poweroff)  works? 

SSDguy801

unread,
Apr 1, 2021, 12:52:57 AM4/1/21
to Alt-F
Joao,

Thanks for replying my friend!

Yeah, I tested /usr/bin/poweroff manually on CLI this afternoon and it does power it down. Just now I tried the /etc/init.d/rcE from CLI, and it sat on a blinking cursor for a few moments, eventually closed the ssh connection, but it didn't power it off (is that because the SSH shell died before it finished)?

I'll have to try a test tomorrow with the /etc/init.d/rcE in the upsmon.conf and see if that one plays any different. Is there a log I can check to see if upsmon tried to do anything when it hit low battery trigger? 

I know I can see the master's UPS in the slave's cgi UI, and I can run 'upsc up...@192.168.10.50' and pull the UPS data from the master just fine...

THANKS
OJ

João Cardoso

unread,
Apr 1, 2021, 3:17:05 PM4/1/21
to Alt-F
On Thursday, April 1, 2021 at 5:52:57 AM UTC+1 SSDguy801 wrote:
Joao,

Thanks for replying my friend!

Yeah, I tested /usr/bin/poweroff manually on CLI this afternoon and it does power it down.

That's what you need to specify in the NUT conf.
 
Just now I tried the /etc/init.d/rcE from CLI, and it sat on a blinking cursor for a few moments, eventually closed the ssh connection, but it didn't power it off (is that because the SSH shell died before it finished)?

It is not intended to be invoked that way. 'poweroff' sends a signal to 'init' , which examines /etc/inittab and executes the script associated with the shutdown action, which is rcE; on return from rcE init tells the kernel to poweroff (except for the DNS-320-Bx, DNS-320L-Ax, DNS-327L-Ax, which have a running dns320l-daemon that controls a chip that does the actual poweroff)


I'll have to try a test tomorrow with the /etc/init.d/rcE in the upsmon.conf and see if that one plays any different. Is there a log I can check to see if upsmon tried to do anything when it hit low battery trigger? 

Instead of /usr/sbin/poweroff, you can specify your own written script that writes something to a file, so you know that it was called. Something like
#!/bin/sh
echo "$0 called with $* arguments" > /tmp/my.log

Notice that I have no experience at all with NUT.

SSDguy801

unread,
Apr 2, 2021, 11:29:16 PM4/2/21
to Alt-F
Thanks for helping me brainstorm here... 

I reverted back to the /usr/sbin/poweroff  command but this time without the -f  (as you had originally advised) and it seems like it worked this time... I also found some general troubleshooting command on other place that helped to show debug output from upsmon which was helpful to show the shutdown had been triggered:


[root@UOSRLC-NAS02]# upsmon -u root -D  start

Network UPS Tools upsmon 2.6.1

   0.000000 UPS: up...@192.168.10.50 (slave) (power value 1)

   0.008106 Using power down flag file /etc/killpower

   0.013170 debug level is '1'

   0.020803 Trying to connect to UPS [up...@192.168.10.50]

   0.031793 Logged into UPS up...@192.168.10.50

4590.935203 UPS up...@192.168.10.50 on battery

sh: wall: not found

4595.937201 UPS up...@192.168.10.50 on line power

sh: wall: not found

5831.178932 UPS up...@192.168.10.50 on battery

sh: wall: not found

10337.058817 UPS up...@192.168.10.50: forced shutdown in progress

10337.059846 UPS up...@192.168.10.50 battery is low

10337.060791 Critical UPS: up...@192.168.10.50

10337.060985 Shutting down any UPSes in MASTER mode...

10337.061147 Executing automatic power-fail shutdown

shshsh: wall: not found

10337.089139 Auto logout and shutdown proceeding

: wall: not found

: wall: not found

sh: wall: not found

[root@UOSRLC-NAS02]# Connection to 192.168.10.51 closed by remote host.

Connection to 192.168.10.51 closed. 

Reply all
Reply to author
Forward
0 new messages