Description of problem: When MODEL is set to "upsdrvctl" in /etc/sysconfig/ups, "service ups restart" does not properly wait until the currently running driver has completely shut down, causing a "/dev/ttyS0 is locked by another process" error message when it tries to restart the driver. Version-Release number of selected component (if applicable): nut-2.0.3-0.1.fc5 How reproducible: Always Steps to Reproduce: 1. Set MODEL=upsdrvctl in /etc/sysconfig/ups 2. Configure your UPS in /etc/ups/ups.conf 3. Run "service start ups" 4. Run "service restart ups" Actual results: # service ups start Starting upsdrvctl: Network UPS Tools - UPS driver controller 2.0.3 Network UPS Tools (version 2.0.3) - APC Smart protocol driver Driver version 1.99.7, command table version 2.0 Detected Smart-UPS SC1000 [xxxxx] on /dev/ttyS0 [ OK ] Starting upsd: Network UPS Tools upsd 2.0.3 Connected to UPS [ups]: apcsmart-ttyS0 Synchronizing.....done [ OK ] Starting UPS monitor (master): Network UPS Tools upsmon 2.0.3 UPS: ups@localhost (master) (power value 1) Using power down flag file /etc/killpower [ OK ] # service ups restart Stopping UPS monitor: [ OK ] Stopping upsd: [ OK ] Shutting down upsdrvctl: Network UPS Tools - UPS driver controller 2.0.3 Stopping UPS: ups Starting upsdrvctl: Network UPS Tools - UPS driver controller 2.0.3 Network UPS Tools (version 2.0.3) - APC Smart protocol driver Driver version 1.99.7, command table version 2.0 /dev/ttyS0 is locked by another process Driver failed to start (exit status=1) [FAILED] [...more failures, snipped...] Expected results: It shouldn't try to restart the driver until the previously running driver has relinquished control of the serial port. Additional info: Adding a "sleep 2" after "/sbin/upsdrvctl stop" in /etc/init.d/ups helps, but I assume that isn't the "right" fix for this. (upsdrvctl should probably wait until the driver process has terminated before returning?)
Still happens in F7's nut-2.0.5-3 package.
*** Bug 248263 has been marked as a duplicate of this bug. ***
An update to nut-2.0.5-4 is still broken. After 'service ups restart' I got: .... Network UPS Tools - Best UPS driver 1.03 (2.0.5) /dev/ttyS0 is locked by another process Driver failed to start (exit status=1) [FAILED] ..... and 'service ups status' shows "bestups is stopped". A workaround described in bug 248263 is still required. It works for that particular case. At least user "nut" is now in "uucp" group so it has a required access to a monitoring serial port.
I have added the sleep in init script in 2.0.5-5, but I don't consider this to be a hack... Please try to update when the nev version gets released.
Worksforme; only I have no idea if a delay value you added is ok for other UPS makes. No problems here as it was derived experimentally for this particular setup.
(In reply to comment #4) > I have added the sleep in init script in 2.0.5-5, nut-2.2.0-3.fc8 seems to be missing the sleep. Reopening. > but I don't consider this to be a hack... With sufficiently high load, it could take longer than X seconds for the process to exit.
This message is a reminder that Fedora 8 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 8. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '8'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 8's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 8 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed.
This still exists in Fedora 12's nut-2.4.3-3.fc12.i686 (In reply to comment #4) > I have added the sleep in init script in 2.0.5-5, ...and I still don't see a "sleep" in the init script.
hi, I can't reproduce this bug in my environment, but I've patched to upsdrvctl to wait for all drivers to terminate which (I believe) should fix your problem. Could you please test following packages: http://kojipkgs.fedoraproject.org/scratch/mhlavink/task_2331096/ thanks
No more need to test packages mentioned above. I've discussed this with upstream. It'd be wrong behaviour waiting for ups driver when nut is stopping (not restarting), because it should stop quite quickly and delaying shutdown process can be harmful. Better approach is sleep in restart between stop and start phases. I've added a few lines in restart function that waits up to 5 seconds for upsdriver to terminate with 1s steps so it won't delay too much if everything is ok.
nut-2.4.3-5.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/nut-2.4.3-5.fc12
nut-2.4.3-5.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/nut-2.4.3-5.fc13
nut-2.2.0-7.el5 has been submitted as an update for Fedora EPEL 5. http://admin.fedoraproject.org/updates/nut-2.2.0-7.el5
nut-2.4.3-5.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.
nut-2.4.3-5.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
nut-2.2.0-7.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.