Bug 151376 - Services/Daemons depending on network shouldn't start if DHCP hasn't recieved an IP Address yet
Summary: Services/Daemons depending on network shouldn't start if DHCP hasn't recieved...
Status: RESOLVED INVALID
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Network (show other bugs)
Version: Beta 3
Hardware: PC SuSE Linux 10.1
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Dr. Werner Fink
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 04:02 UTC by Justin Haygood
Modified: 2006-02-17 15:47 UTC (History)
2 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Haygood 2006-02-16 04:02:00 UTC
Services that require the network to be up at start shouldn't be started until an IP Address is recieved yet and/or the network is functional.

I'm on a wired & sometimes wireless connection, and my wired/wireless router at home takes forver to issue an IP Address through DHCP.

One such service is ntpd.

I see two, maybe three,  ways for fixing this, especially if NetworkManager is used:

1. Make init understand NetworkManager (might not be possible.. init is needed before dbus ever starts, I'm not sure)

2. Make the offending daemons understand NetworkManager if enabled, and not do their stuff until NetworkManager reports that a network connection is up

3. Use a ifnetworkup wrapper or something similar that checks to see if NetworkManager reports a network connection is up, and if not, wait until its up to start the services, and stop them when the network connection is down (this makes it so init doesn't need to understand it directly)

Possibly alot other ways of doing this. This will definely improve user experience, as it makes it act more similar to Windows XP's NTP synchronization, etc...
Comment 1 Michael Gross 2006-02-16 12:42:10 UTC
Can you point out more services that are affected by this? If your DHCP server is so slow, maby you should increase the timeout value?
Comment 2 Justin Haygood 2006-02-16 12:51:05 UTC
I don't have very many services running on here (tis a laptop), but some others I can probably think of that might be good:

NFS / SMB mounting of remote directories (maybe) if any is done during initial init

Possibly others, essentially any daemon that needs Internet access when it starts.

The DHCP server is slow, but it takes it around 6 seconds to send an IP address. ntpd starts up almost immediately after NetworkManager (less than 2 seconds) and fails because it can't connect.

Comment 3 Michael Gross 2006-02-16 14:48:20 UTC
Let's ask Werner for a comment here.
I also take the gnome maintainers (NetworkManager) into CC.
Comment 4 Michael Gross 2006-02-17 11:13:10 UTC
Reassigning, this would be something for Werner anyway...
Comment 5 Hendrik Vogelsang 2006-02-17 13:48:43 UTC
if your services depend on an _configured_ device opposed to an started device you have to use the configuration process and not the start process 

for traditional setup this would be 
/etc/sysconfig/ifservice-<id>

like

/etc/sysconfig/ifservice-eth0/S01service -> ../../../init.d/service
/etc/sysconfig/ifservice-eth0/K99service -> ../../../init.d/service

for NetworkManager that is 

/etc/NetworkManager/dispatcher.d
Comment 6 Justin Haygood 2006-02-17 15:47:37 UTC
Then shouldn't YaST automatically configure services it configures to do this? The service in question that's the main problem (ntpd) was configured by doing the following:

1. Opening YaST
2. Choosing Network Services
3. Choosing NTP client
4. Automatically Start NTP Daemon during boot is checked
5. Use Random Services from NTP Pool is checked
6. Clicking Finish

Since the GUI configured it, it should automatically configure everything needed I believe. I'm not exactly a UNIX/Linux guru (tho I am a programmer, I don't delve into system details if I don't have to).