Bug 852335 - nut-server.service fails to start at boot when nut is configured in netserver mode
Summary: nut-server.service fails to start at boot when nut is configured in netserver...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-28 08:34 UTC by Dan Ziemba
Modified: 2013-01-14 20:19 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-01-14 20:19:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
log excerpt from /var/log/messages at boot (9.86 KB, text/plain)
2012-08-28 08:34 UTC, Dan Ziemba
no flags Details
boot.log (54.63 KB, application/octet-stream)
2012-09-06 13:48 UTC, Dan Ziemba
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.