Roger,

Thank you for the help.

I tried what you suggested, going the system service unit route.  Well...that 
works.  So unfortunately, it doesn't provide a lot of debugging information. 
But I guess it also gives me a method I can move forward with.

I had preferred the shutdown script method because it was a little more 
straight-forward, and possibly more portable.  This guide is meant to help 
people get the UPS up and running, whatever their Linux distro. I don't know 
how common the systemd implementation is across various Linux distros.  

The fact that I had the script working perfectly a few months ago makes me 
suspect this might be an openSUSE bug, and maybe that version I used back then 
had been updated.  Now that I have a working solution, I might let my install 
update overnight and then try the shutdown script again.  I assume that to undo 
the systemd service unit method, I do something like "systemctl --system 
disable /etc/syst......"?

Rob Groner
Software Engineer Level II

RTD Embedded Technologies, Inc.
ISO 9001 and AS9100 Certified
Ph: +1 814-234-8087
www.rtd.com

-----Original Message-----
From: Nut-upsuser 
[mailto:nut-upsuser-bounces+rgroner=rtd....@lists.alioth.debian.org] On Behalf 
Of Roger Price
Sent: Thursday, September 03, 2015 11:18 AM
To: nut-upsuser Mailing List <nut-upsuser@lists.alioth.debian.org>
Subject: Re: [Nut-upsuser] UPS/NUT with openSUSE 13.1

On Thu, 3 Sep 2015, Rob Groner wrote:

> I’ve followed your excellent guide for setting up NUT in openSUSE 
> 13.1. I’ve had great luck IN THE PAST, but for some reason now that I 
> am trying to set it up again from scratch, I’m getting a weird error.
> 
> Everything works except for the UPS shutdown.  I put the script in 
> /usr/lib/system/system-shutdown and made it executable.  In fact, if I 
> execute it manually...it will shut down the UPS (and then bring it 
> back up).  However, if I shut down normally, either the script does 
> not execute, or the UPS simply fails to receive it.  In a previous 
> system when I did this, it worked perfectly (almost too well, as I’d 
> sometimes forget when simply rebooting the system that it had 
> commanded the UPS to shutdown 20 seconds later…).  Do you have any 
> suggestions as to why the script works fine when I execute it 
> manually, but doesn’t work when the system actually shuts down?

Hello Bob, I'll reply via the NUT mailing list since others may be interested, 
and the list will archive the discussion.

Putting the shutdown script in /usr/lib/system/system-shutdown so that systemd 
will execute it as late as possible makes it difficult to debug what happens, 
or doesn't happen, since when the script is executed, it is no longer possible 
to write out any trace statements.

So I suggest that temporarily you use the systemd service unit approach which 
will place a record in /var/log/messages. This is easier to debug. 
Once you have found out why the required shutdown has not happened, you can 
test the fix, and when it works go back to using a script in 
/usr/lib/system/system-shutdown

Don't forget that you will have to initialize the service unit with a command 
such as
   systemctl --system reenable /etc/systemd/system/ups-delayed-shutdown.service

Best Regards,
Roger
_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to