Description of problem: When apcupsd is started _without_ waiting for the network to be up, then the software doesn't function properly and does _not_ recover. Version-Release number of selected component (if applicable): How reproducible: always Steps to Reproduce: 1. configure apcupsd for a network UPS, for example: UPSCABLE ether UPSTYPE snmp DEVICE 192.168.1.1:161:APC:private POLLTIME 30 BATTERYLEVEL 10 MINUTES 10 2. enable and start systemctl enable apcupsd.service systemctl restart apcupsd.service 3. reboot 4. run apcacess --> The UPS data is not available and will not be even after multiple POLLTIMEs Additional info: I need to add # apc sw doesn't start properly when there is no network yet systemctl enable NetworkManager-wait-online.service to work around this
Version-Release number of selected component (if applicable): apcupsd-3.14.13-4.fc23.x86_64 (but has been present for a loooong time, only now came to filing a bug)
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
I've just taken over this package and am looking through the tickets. The Fedora package actually uses the upstream unit file, but my understanding of the network issue is that it is indeed not sufficient to use After=network.target. Can you disable the NetworkManager-wait-online service, and drop this into /etc/systemd/system/apcupsd.service.d/apcupsd.conf: [Unit] After=network-online.target then systemctl daemon-reload and then do your usual tes5ting and let me know if that's any better? You can delete that file and the apcupsd.service.d directory after testing if you like. I'm going to go ahead and just make the change in at least the rawhide package now, but it would be good to have confirmation.
Also, I was wrong; upstream doesn't provide a unit file at all. For some reason it was being included in the Fedora package by way of a patch, not as actual files. I've fixed that up and made sure that the daemon starts after network-online target, at least on rawhide. I'll submit an update after I've done a bit more testing.
(In reply to Jason Tibbitts from comment #4) > I've just taken over this package and am looking through the tickets. > > The Fedora package actually uses the upstream unit file, but my > understanding of the network issue is that it is indeed not sufficient to > use After=network.target. > > Can you disable the NetworkManager-wait-online service, and drop this into > /etc/systemd/system/apcupsd.service.d/apcupsd.conf: > > [Unit] > After=network-online.target > Doesn't work. The test is to reboot, then login and then see that apcaccess doesn't show ups data (for me, with a SNMP base APC ups) > then systemctl daemon-reload and then do your usual tes5ting and let me know > if that's any better? You can delete that file and the apcupsd.service.d > directory after testing if you like. > > I'm going to go ahead and just make the change in at least the rawhide > package now, but it would be good to have confirmation.
And it seems that even enabling NetworkManager-wait-online service is no longer sufficient
Setting 'After=network-online.target' in /lib/systemd/system/apcupsd.service also doesn't work
On F24 this is seriously biting me (now installing F24 servers) I have resorted to: # apc sw doesn't start properly when there is no network yet cat > /etc/NetworkManager/dispatcher.d/99-apcupsd << "EOF" #!/bin/sh # This is a NetworkManager dispatcher script for apcupsd to restart export LC_ALL=C if [ "$2" = "up" ]; then systemctl restart apcupsd.service &> /dev/null fi exit 0 EOF
(In reply to Ferry Huberts from comment #9) > On F24 this is seriously biting me (now installing F24 servers) > > I have resorted to: > > > # apc sw doesn't start properly when there is no network yet > cat > /etc/NetworkManager/dispatcher.d/99-apcupsd << "EOF" > #!/bin/sh > # This is a NetworkManager dispatcher script for apcupsd to restart > > export LC_ALL=C > > if [ "$2" = "up" ]; then > systemctl restart apcupsd.service &> /dev/null > fi > > exit 0 > EOF #!/bin/bash # This is a NetworkManager dispatcher script for apcupsd to restart since # apcupsd doesn't start properly when there is no network yet set -u set +e systemctl -q is-enabled apcupsd.service 2> /dev/null if [ $? -ne 0 ]; then exit 0 fi set -e if [ "$2" = "up" ]; then systemctl restart apcupsd.service &> /dev/null fi
This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. 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 EOL if it remains open with a Fedora 'version' of '24'. 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. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 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, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. 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.
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 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. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.