Bug 1019822

Summary: Network not started when /etc/rc.d/rc.local executed
Product: [Fedora] Fedora Reporter: benjamin.barras <benjamin.barras>
Component: initscriptsAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19CC: iarlyy, jonathan, lnykryn, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-17 12:39:42 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:

Description benjamin.barras@epfl.ch 2013-10-16 13:09:00 UTC
Description of problem:

Network not started when /etc/rc.d/rc.local started.
wget doesn't work !!!

Version-Release number of selected component (if applicable):


How reproducible:
put this line in /etc/rc.d/rc.local :

wget -O /root/.ssh/authorized_keys http://myServer/authorized_keys

with

#!/bin/sh

at the first line of course !

Steps to Reproduce:
1. Put the line above
2: chmod +x /etc/rc.d/rc.local

Actual results:

ls -al .ssh
0 Oct 16 14:58 authorized_keys

Expected results:

216 Jan 24  2013 authorized_keys

Additional info:

If I add this line in /etc/rc.d/rc.local before wget :

sleep 5

and after reboot :

ls -al .ssh
216 Jan 24  2013 authorized_keys

it's ok.

Comment 1 Lukáš Nykrýn 2013-10-16 13:22:06 UTC
Are you using NetworkManager?

Comment 2 benjamin.barras@epfl.ch 2013-10-16 13:34:28 UTC
It's a fresh installation with a kickstart file. If I look, I have this :

systemctl status NetworkManager.service
NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled)
   Active: active (running) since Wed 2013-10-16 15:01:22 CEST; 27min ago
 Main PID: 444 (NetworkManager)
   CGroup: name=systemd:/system/NetworkManager.service
           └─444 /usr/sbin/NetworkManager --no-daemon

systemctl status network.target
network.target - Network
   Loaded: loaded (/usr/lib/systemd/system/network.target; static)
   Active: active since Wed 2013-10-16 15:01:22 CEST; 27min ago
     Docs: man:systemd.special(7)
           http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

Comment 3 Lukáš Nykrýn 2013-10-16 14:22:00 UTC
So, actually this has to do nothing with initscripts, but I think that correct solution for you would be to set 'systemctl enable NetworkManager-wait-online.service'

http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

Comment 4 Lukáš Nykrýn 2013-10-16 14:56:15 UTC
or add
nm-online
to rc.local before wget

Comment 5 benjamin.barras@epfl.ch 2013-10-17 12:16:05 UTC
(In reply to Lukáš Nykrýn from comment #3)
> So, actually this has to do nothing with initscripts, but I think that
> correct solution for you would be to set 'systemctl enable
> NetworkManager-wait-online.service'
> 
> http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

systemctl enable NetworkManager-wait-online.service

and all it's ok !

Thanks & best regards,
Benjamin