richjunk at pacbell.net
2018-Jul-28 02:14 UTC
[Nut-upsuser] Can Not Get UPS to Turn Off After System Shutdown
I just installed NUT on a new Linux (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: 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": 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 at 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: # /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 --------------------- OS: Gentoo Linux: Gentoo Base System release 2.4.1 Linux Kernel: 4.17.10-gentoo NUT version: 2.7.4 (Installed via Gentoo Portage: (ie. "emerge nut") UPS info (from upsc): device.mfr: EATON device.model: Eaton 5SC 1500 device.type: ups driver.name: usbhid-ups driver.version: 2.7.4 driver.version.data: MGE HID 1.39 driver.version.internal: 0.41
Roger Price
2018-Jul-28 09:05 UTC
[Nut-upsuser] Can Not Get UPS to Turn Off After System Shutdown
On Fri, 27 Jul 2018, richjunk at pacbell.net wrote:> ... 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: > > SHUTDOWNCMD "/usr/sbin/upsdrvctl shutdown Eaton5SC1500 ; /sbin/shutdown -h +0"Is this something specifically Gentoo? I would have expected to see the « /usr/sbin/upsdrvctl shutdown Eaton5SC1500 » in a systemd script executed during the system shutdown process. Does such a systemd script exist? If so, what does it do? Is it executed?> Running upsdrvctl in test mode doesn't tell me much: > > # /usr/sbin/upsdrvctl -t shutdown Eaton5SC1500 > Network UPS Tools - UPS driver controller 2.7.4 > *** Testing mode: not calling exec/kill > 0.000000 > ... > 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 -kTry the command « /lib64/nut/usbhid-ups -a Eaton5SC1500 -k » Roger
Denny Page
2018-Jul-28 18:03 UTC
[Nut-upsuser] Can Not Get UPS to Turn Off After System Shutdown
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> On Jul 27, 2018, at 19:14, richjunk at pacbell.net wrote: > > This is the shutdown command I am using in /etc/nut/upsmon.conf: > > 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.
richjunk at pacbell.net
2018-Jul-29 02:02 UTC
[Nut-upsuser] Can Not Get UPS to Turn Off After System Shutdown
Denny: Thank you. 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 did contain the message you pointed out. I should have checked that. Thanks again. R On 07/28/2018 11:03 AM, Denny Page wrote:> 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:...> * > * 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 > > > >> On Jul 27, 2018, at 19:14, richjunk at pacbell.net wrote: >> >> This is the shutdown command I am using in /etc/nut/upsmon.conf: >> >> 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.