View previous topic :: View next topic |
Author |
Message |
jagdpanther l33t
Joined: 22 Nov 2003 Posts: 729
|
Posted: Fri Jul 27, 2018 2:46 am Post subject: solved NUT: Can't Get UPS to Turn Off After System Shutdown |
|
|
I just installed NUT on a new Gentoo system. Most things work, (notification after 10 seconds on battery, notification and system shutdown after 100 seconds on battery.) However I can't seem to get the UPS (an Eaton 5SC1500) to turn itself off after the Gentoo system shutdown.
This is the shutdown command I am using in /etc/nut/upsmon.conf:
Code: | SHUTDOWNCMD "/usr/sbin/upsdrvctl shutdown Eaton5SC1500 ; /sbin/shutdown -h +0" |
The /etc/shutdown part works. The UPS name, Eaton5SC1500, is correct because the command 'upsc Eaton5SC1500' lists the current parameters of the ups.
Here is part of /var/log/messages during my last test "power outage":
Code: | Jul 26 19:08:57 run-public upssched[4923]: Event: timeshutdown
Jul 26 19:08:57 run-public upssched-cmd[4940]: The UPS has been on battery for 100 seconds -- shutting down
Jul 26 19:08:57 run-public upsmon[4897]: Signal 10: User requested FSD
Jul 26 19:08:57 run-public upsmon[4897]: FSD set on UPS Eaton5SC1500@127.0.0.1 failed: ERR ACCESS-DENIED
Jul 26 19:08:57 rur-public upsmon[4897]: Executing automatic power-fail shutdown
Jul 26 19:08:57 run-public upsmon[4897]: Auto logout and shutdown proceeding |
Any idea on what is causing that ERR ACCESS-DENIED message?
Running upsdrvctl in test mode doesn't tell me much:
Code: | # /usr/sbin/upsdrvctl -t shutdown Eaton5SC1500
Network UPS Tools - UPS driver controller 2.7.4
*** Testing mode: not calling exec/kill
0.000000
If you're not a NUT core developer, chances are that you're told to enable debugging
to see why a driver isn't working for you. We're sorry for the confusion, but this is
the 'upsdrvctl' wrapper, not the driver you're interested in.
Below you'll find one or more lines starting with 'exec:' followed by an absolute
path to the driver binary and some command line option. This is what the driver
starts and you need to copy and paste that line and append the debug flags to that
line (less the 'exec:' prefix).
0.000137 Shutdown UPS: Eaton5SC1500
0.000151 exec: /lib64/nut/usbhid-ups -a Eaton5SC1500 -k |
Last edited by jagdpanther on Sun Jul 29, 2018 2:00 am; edited 1 time in total |
|
Back to top |
|
|
jagdpanther l33t
Joined: 22 Nov 2003 Posts: 729
|
Posted: Sun Jul 29, 2018 1:58 am Post subject: |
|
|
From the nut-upsuser list:
Quote: | This really isn’t what you want.
You should use a normal shutdown command on Gentoo:
SHUTDOWNCMD "/sbin/shutdown -h +0”
When you emerged the NUT package, you should have seen this message:
* Please note that NUT now runs under the 'nut' user.
* NUT is in the uucp group for access to RS-232 UPS.
* However if you use a USB UPS you may need to look at the udev or
* hotplug rules that are installed, and alter them suitably.
*
* You are strongly advised to read the UPGRADING file provided by upstream.
*
* Please note that upsdrv is NOT automatically started by upsd anymore.
* If you have multiple UPS units, you can use their NUT names to
* have a service per UPS:
* ln -s /etc/init.d/upsdrv /etc/init.d/upsdrv.$UPSNAME
*
* If you want apcupsd to power off your UPS when it
* shuts down your system in a power failure, you must
* add nut.powerfail to your shutdown runlevel:
*
* rc-update add nut.powerfail shutdown
The thing in particular to pay attention to is the last line.
Denny |
Problem solved.
I switched SHUTDOWNCMD back to the default and added nut.powerfail to the shutdown runlevel. Now the UPS turns off after the system shutdown, if the shutdown is caused by lack of power going to the UPS.
I checked and found the file sys-power:nut-2.7.4-r1:2018...log in /var/log/portage/elog/*. It contains that message about adding nut.powerfail to the shutdown runlevel. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|