Ivan Adzhubey
2016-Jul-12 21:27 UTC
[Nut-upsuser] FSD sequence not working on Ubuntu 16.04 LTS
Hi, I have recently installed NUT 2.7.3.1 on a freshly installed Ubuntu 16.04 LTS (64-bit) system, connected via USB cable to APC Smart-UPS 1500 (SMT model). I am trying to make this configuration work for automatic shutdown/restart but it seems that it completely ignores /etc/killpower presence. I know the APC SMT models are problematic but it looks like I could not even make the simplest test work, so it is likely initscripts issue and not the driver/UPS. "upsmon -c fsd" would just initiate normal full shutdown sequence (e.g. exactly the same as "shutdown -h +0") with the system brought to full poweroff while UPS still keeps load powered. Obviously, this never restarts the system automatically. Note, I am currently running NUT installed from Rodney Dawes "System Tools" PPA since the standard 16.04 repository has a fairly old version (2.7.2): https://launchpad.net/~dobey/+archive/ubuntu/systools/ However, upgrading to this PPA build did not have any effect on the incorrect shutdown sequence issue. I was wondering if anyone can confirm a working NUT configuration on Ubuntu 16.04 LTS. So far, I am pretty sure this is Ubuntu bug, not the NUT one but I might be wrong, of course. Would be nice to have some feedback from others. My NUT components configuration and the UPS status/variables dump are available on request. Thank you, Ivan -- Ivan Adzhubey, Ph.D. Instructor Division of Genetics, Dept of Medicine Brigham & Women's Hospital Harvard Medical School New Research Building, Room 0464C 77 Avenue Louis Pasteur Boston, MA 02115 tel.: (617) 525-4728 fax: (617) 525-4705 web: http://genetics.bwh.harvard.edu/wiki/sunyaevlab/
Charles Lepple
2016-Jul-14 03:40 UTC
[Nut-upsuser] FSD sequence not working on Ubuntu 16.04 LTS
[please use Reply-All to include the list. thanks!] On Jul 12, 2016, at 5:27 PM, Ivan Adzhubey <iadzhubey at rics.bwh.harvard.edu> wrote:> > I have recently installed NUT 2.7.3.1 on a freshly installed Ubuntu 16.04 LTS > (64-bit) system, connected via USB cable to APC Smart-UPS 1500 (SMT model). I > am trying to make this configuration work for automatic shutdown/restart but it > seems that it completely ignores /etc/killpower presence. I know the APC SMT > models are problematic but it looks like I could not even make the simplest > test work, so it is likely initscripts issue and not the driver/UPS.The only Ubuntu 16.04 system I have worked with is a laptop (so no UPS), and I have to say that it doesn't feel as much like an LTS release as 14.04. Can you reproduce the shutdown issue with upstart instead of systemd? (alternate GRUB menu option, IIRC) I'm not sure if the PPA is the best solution at the moment, or whether the Ubuntu systemd files have been merged in. There is the following comment in the buildlog: # Install systemd files only on systems where it's supported # disabled in Ubuntu until the unit gets fixed to check nut.conf I would recommend filing a bug with Ubuntu. It would help them track things down if you can identify the logs which should be running the systemd equivalent of "upsdrvctl shutdown" or "<driver> -k". -- Charles Lepple clepple at gmail
Ivan Adzhubey
2016-Jul-15 22:05 UTC
[Nut-upsuser] FSD sequence not working on Ubuntu 16.04 LTS
Hi Charles, On Wednesday, July 13, 2016 11:40:09 PM Charles Lepple wrote:> On Jul 12, 2016, at 5:27 PM, Ivan Adzhubey <iadzhubey at rics.bwh.harvard.edu> > wrote: > > I have recently installed NUT 2.7.3.1 on a freshly installed Ubuntu 16.04 > > LTS (64-bit) system, connected via USB cable to APC Smart-UPS 1500 (SMT > > model). I am trying to make this configuration work for automatic > > shutdown/restart but it seems that it completely ignores /etc/killpower > > presence. I know the APC SMT models are problematic but it looks like I > > could not even make the simplest test work, so it is likely initscripts > > issue and not the driver/UPS. > > The only Ubuntu 16.04 system I have worked with is a laptop (so no UPS), and > I have to say that it doesn't feel as much like an LTS release as 14.04. > Can you reproduce the shutdown issue with upstart instead of systemd? > (alternate GRUB menu option, IIRC)Ubuntu Server 16.04 does not have the upstart option on boot menu. In fact, I do not believe any Ubuntu Server used it, ever. Anyway, now that even Debian announced dropping support for sysvinit compatibility we will have to learn how to live with systemd, like it or not.> I'm not sure if the PPA is the best solution at the moment, or whether the > Ubuntu systemd files have been merged in. There is the following comment in > the buildlog: > > # Install systemd files only on systems where it's supported > # disabled in Ubuntu until the unit gets fixed to check nut.conf > > I would recommend filing a bug with Ubuntu. It would help them track things > down if you can identify the logs which should be running the systemd > equivalent of "upsdrvctl shutdown" or "<driver> -k".The bug was caused by the NUT package lacking systemd-specific halt/poweroff script. Ubuntu 16.04 have systemd SysV init compatibility layer installed by default and it works fine for most of the services managed by legacy initscripts. However, the one important exception is halt/poweroff/reboot mechanism, for which there is no compatibility support. Systemd does not run /etc/init.d/halt script at all, while NUT relies on this script to run /etc/init.d/ups-monitor command which, in turn, checks for the presence of killpower flag and run "nut-server poweroff" command to cut the UPS load power, if that flag is found. I followed the instructions on this blog: https://www.kepstin.ca/blog/networkupstoolsnutandsystemd/ by creating the file /lib/systemd/system-shutdown/nutshutdown with the following commands in it: #!/bin/sh /sbin/upsmon -K >/dev/null 2>&1 && /sbin/upsdrvctl shutdown After that, NUT server would correctly process power loss events (both real and simulated) by cutting UPS power after a system shutdown and restarting it after a short delay when/if the power is back. I am going to file a bug report at Launchpad for this issue. Thanks, Ivan