holomek at seznam.cz
2016-Apr-22 02:43 UTC
[Nut-upsuser] upsmon errors with /usr/sbin/pm-suspend as the shutdown command
Hi, While using pm-suspend script as the SHUTDOWNCMD, upsmon does not correctly handle its returned values and leaves UPS in the "ups.status: FSD OL CHRG" state forever. This is with upsmon 2.6.5 from official Fedora Project packager. Box running Centos 6.7. Initially, upsmon would not execute pm-suspend at all. Creation of a custom SELinux module or changing to Permissive mode allows the box to suspend, but UPS is never power-cycled afterwards. After resuming, upsmon throws "parent: Unable to call shutdown command: /usr/sbin/pm-suspend" to syslog and crashes. Similar issue was discussed here: https://lists.alioth.debian.org/pipermail/nut-upsuser/2013-December/008711.html - but now we can consider SELinux eliminated from the equation. With the default "shutdown -h" everything works fine. What else can be tried? Thanks, Jan
holomek at seznam.cz
2016-Apr-29 23:01 UTC
[Nut-upsuser] upsmon errors with /usr/sbin/pm-suspend as the shutdown command
Is nobody using pm-suspend or pm-hibernate with upsmon? Or any other shutdown command besides the default one? Thanks, Jan On 22.4.2016 4:43, holomek at seznam.cz wrote:> Hi, > > While using pm-suspend script as the SHUTDOWNCMD, upsmon does not > correctly handle its returned values and leaves UPS in the > "ups.status: FSD OL CHRG" state forever. > > This is with upsmon 2.6.5 from official Fedora Project packager. Box > running Centos 6.7. > > Initially, upsmon would not execute pm-suspend at all. Creation of a > custom SELinux module or changing to Permissive mode allows the box to > suspend, but UPS is never power-cycled afterwards. > > After resuming, upsmon throws "parent: Unable to call shutdown > command: /usr/sbin/pm-suspend" to syslog and crashes. > > Similar issue was discussed here: > https://lists.alioth.debian.org/pipermail/nut-upsuser/2013-December/008711.html > - but now we can consider SELinux eliminated from the equation. With > the default "shutdown -h" everything works fine. > > What else can be tried? > > Thanks, > Jan > > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at lists.alioth.debian.org > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Charles Lepple
2016-May-01 19:24 UTC
[Nut-upsuser] upsmon errors with /usr/sbin/pm-suspend as the shutdown command
On Apr 29, 2016, at 7:01 PM, holomek at seznam.cz wrote:> > Is nobody using pm-suspend or pm-hibernate with upsmon? Or any other shutdown command besides the default one?The documentation for this use case was written a long time ago, and I'm not sure if all of the details were worked out. From the manual <http://networkupstools.org/docs/user-manual.chunked/ar01s06.html#_using_suspend_to_disk>:> In order for this to work, you need to shutdown NUT (UPS driver, upsd server and upsmon client) in the suspend script and start them again in the resume script. Don?t try to keep them running. The upsd server will latch the FSD state (so it won?t be usable after resuming) and so will the upsmon client. Some drivers may work after resuming, but many don?t and some UPSs will require re-initialization, so it?s best not to keep this running either. > > After stopping driver, server and client you?ll have to send the UPS the command to shutdown only if the POWERDOWNFLAG is present. Note that most likely you?ll have to allow for a grace period after sending upsdrvctl shutdown since the system will still have to take a snapshot of itself after that. Not all drivers support this, so before going down this road, make sure that the one you?re using does.In order to do the driver/server/client shutdown mentioned above, you would probably need to write some hook scripts for the pm-* system. I would make sure that the UPS and driver properly implement the grace period mentioned in the second paragraph before working on the hook scripts. -- Charles Lepple clepple at gmail