:: [DNG] devuan chimaera and NUT shutd…
Top Page
Delete this message
Reply to this message
Author: nate
Date:  
To: dng
Subject: [DNG] devuan chimaera and NUT shutdown failure
Hello folks - hope your day is going well.

I had a funky power situation this morning, power problems at home are
super
rare and this is the first time I want to say in 10+ years that I've
actually
had my UPS run out of battery on me.

What surprised me was that the shutdown command coming from NUT to my
devuan
chimaera server failed to run. So the system shutdown unclean. I never
tested
it I just assumed it would work but in the worst case if it did not(as
it did
not) not a huge deal for me.

The error in the log was
upsmon[2384]: parent: Unable to call shutdown command: /sbin/shutdown -h
+0

But I looked into it a bit further and it appears to be an issue with
Devuan
itself, fortunately the fix(for NUT) is simple, am unsure how else to
report
this. I poked at Devuan's bug reporting site and it says the package
nut-client does not exist(it lists several other NUT packages though),
so
perhaps Devuan does no modifications to the Debian upstream package.

The command NUT uses to shutdown by default is this:

SHUTDOWNCMD "/sbin/shutdown -h +0"

This does not work on Devuan Chimera. It does work on Ubuntu 20.04, and
on
Devuan beowulf. I don't have a Debian system handy that I'm willing to
shut
down to test, but am assuming it probably works on Debian as well. I did
download the NUT source package from Debian stable(along with the other
files
and used dpkg-source to extract)
https://packages.debian.org/bullseye/nut-client

And did my best to verify that command is what ships with Debian(that is
what
is in the original source and I found no evidence there was a Debian
patch
to change the behavior).

On Devuan Chimaera running this command results in just getting the
usage
statement back:

--------------
root@repos:~# /sbin/shutdown -h +0
Usage:      shutdown [-akrhPHfFnc] [-t sec] time [warning message]
          -a:      use /etc/shutdown.allow
          -k:      don't really shutdown, only warn.
          -r:      reboot after shutdown.
          -h:      halt after shutdown.
          -P:      halt action is to turn off power.
                   can only be used along with -h flag.
          -H:      halt action is to just halt.
                   can only be used along with -h flag.
          -f:      do a 'fast' reboot (skip fsck).
          -F:      Force fsck on reboot.
          -n:      do not go through "init" but go down real fast.
          -c:      cancel a running shutdown.
          -q:      quiet mode - display fewer shutdown warnings.
          -Q:      full quiet mode - display only final shutdown warning.
          -t secs: delay between warning and kill signal.
          ** the "time" argument is mandatory! (try "now") **
---------


So the workaround I guess would be to change the +0 to say now in the
NUT
configuration.

My Beowulf system has sysvinit (which shutdown appears to come from)
version
2.93-8+devuan1 and my Chimeara system has 2.96-7+devuan1. Nothing stands
out in the changelog for sysvinit to explain this kind of behavioral
change.

Or perhaps the bug is in the sysvinit package and that the fact that
this
shutdown command does not work is the problem rather than changing NUT
to
call another option. I don't know. Personally when I shut down a system
I always use the halt command and to reboot I always use reboot, I never
use shutdown just out of habbit(Linux user since 1996). So I don't have
an opinion one way or another to judge what the most correct behavior
is.

thanks

nate