Bug 852335

Summary: nut-server.service fails to start at boot when nut is configured in netserver mode
Product: [Fedora] Fedora Reporter: Dan Ziemba <zman0900>
Component: systemdAssignee: systemd-maint
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: johannbg, lnykryn, lpoetter, metherid, mhlavink, msekleta, notting, plautrba, systemd-maint, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-14 20:19:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
log excerpt from /var/log/messages at boot
none
boot.log none

Description Dan Ziemba 2012-08-28 08:34:23 UTC
Created attachment 607443 [details]
log excerpt from /var/log/messages at boot

Description of problem:
When nut is running in netserver mode, nut-server.service fails to start at system boot.  Running `systemctl start nut-server.service` after boot completes works fine.  

In upsd.conf, I have nut set to listen on localhost and 192.168.1.102.  The machine gets that address from DHCP, but it is always the same, so hard-coding it shouldn't be an issue (Oddly nut seems to have no option to specify an interface without knowing its ip).

Despite the nut-server.service file having "After=network.target", the service gets started before network manager, causing it to fail because the network interface isn't up yet.  I'm not sure if this is a bug with the service files, or a bug with systemd.

Version-Release number of selected component (if applicable):
2.6.5-1.fc16.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install nut and configure in netserver mode.
2. Set listen address to network interface's ip and enable start at boot.
3. Reboot.
  
Actual results:
Service doesn't start as expected.  nut-driver and nut-monitor services still load.

Expected results:
nut-server service starts andl functions as configured.

Additional info:
Log file is attached.

Comment 1 Dan Ziemba 2012-08-28 08:47:15 UTC
I've just tried switching to a manual address instead of DHCP, but the same problem is still happening.  nut-server still tries to start before NetworkManager brings up the interface.

Comment 2 Michal Hlavinka 2012-09-05 17:41:57 UTC
please attach /var/log/boot.log

Comment 3 Dan Ziemba 2012-09-06 13:48:32 UTC
Created attachment 610339 [details]
boot.log

Comment 4 Michal Hlavinka 2012-09-17 15:02:33 UTC
Looking at boot.log, nut starts after NetworkManager.

The problem is that "After=network.target" is quite useless. It does not mean the network is ready. What it means is that NetworkManager has started, but not necessarily that all interfaces were brought up. We can't change the "After=" to anything, because there is no "online.target" or anything that would trigger when network is really usable. Unfortunately, this is one of the design flaws.

Comment 5 Lennart Poettering 2012-09-17 17:00:50 UTC
Does "systemctl enable NetworkManager-wait-online.service" fix your issue?

Comment 6 Lennart Poettering 2013-01-14 20:19:54 UTC
No response, so closing.