Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ntp-client kicks in too soon
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
javeree_work
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2005
Posts: 84

PostPosted: Wed Jun 22, 2005 8:58 am    Post subject: ntp-client kicks in too soon Reply with quote

Since I updated to the new baselayout a few days ago, it seems that .etc/init.d/ntp-client starts too soon.

During boot, I see net.eth0 starting eth0, then it says starting dhcp, and then I see a message saying ntp-client starts, but a bit afterwards, it says 'failed to set clock'. Only AFTER that does dhcpd appear and does an IP-number and a gateway assigned.

I have the impression that 'need net, use dns' in ntp-client is either not honored, or that net.eth0, which seems to have changed (and become more complicated) provides 'net' even before an IP address is assigned by dhcpd.
Does anyone have the same problem ? What is the best way to fix it ?

P.S. I could not find an explanation of 'need' versus 'use' except that one was stricter than the other. Does anyone know what 'stricter' mean ?

P.P.S As I am using ntp-client, I would like to eliminate the 'clock' startup script which takes rather long to run. However, some essential scripts say to rely on clock. Is this dependency really needed, or is there a way to prevent clock from running and just wait for ntp-client to set the clock ?
Back to top
View user's profile Send private message
mark_alec
Bodhisattva
Bodhisattva


Joined: 11 Sep 2004
Posts: 6066
Location: Melbourne, Australia

PostPosted: Wed Jun 22, 2005 10:50 am    Post subject: Reply with quote

I hope that this clears up the difference between need and use. For more info see the documentation I'm quoting from.

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4 wrote:
Dependencies

There are two dependencies you can define: use and need. As we have mentioned before, the need dependency is more strict than the use dependency. Following this dependency type you enter the service you depend on, or the virtual dependency.

A virtual dependency is a dependency that a service provides, but that is not provided solely by that service. Your init script can depend on a system logger, but there are many system loggers available (metalogd, syslog-ng, sysklogd, ...). As you cannot need every single one of them (no sensible system has all these system loggers installed and running) we made sure that all these services provide a virtual dependency.

Let us take a look at the dependency information for the postfix service.

Code Listing 17: Dependency information for Postfix
Code:

depend() {
  need net
  use logger dns
  provide mta
}


As you can see, the postfix service:

* requires the (virtual) net dependency (which is provided by, for instance, /etc/init.d/net.eth0)
* uses the (virtual) logger dependency (which is provided by, for instance, /etc/init.d/syslog-ng)
* uses the (virtual) dns dependency (which is provided by, for instance, /etc/init.d/named)
* provides the (virtual) mta dependency (which is common for all mail servers)
Back to top
View user's profile Send private message
javeree_work
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2005
Posts: 84

PostPosted: Thu Jun 23, 2005 8:16 am    Post subject: Reply with quote

This was exactly the page I was thinking of when I said that it didn't clarify what 'stricter' means.

This example 'needs' net, and 'uses' dns. wouldn't that mean that without dns being started the script cannot run => if it 'uses' it, it would also 'need' it. (I probably assign too much semantics to these words) ?

My expectation would be that 'need' would be less strict than use. E.g. I can imagine a situation where a script says it needs to have service started without using it. E.g. I could imagine saying I 'need' the hdparm script to have run (because of efficiency) before I run other scripts, although there is no actual service I am using. Still, the difference would be subtle and have no influence on the order in which services are run.

With the explanation above, I still don't see what the consequences would be if

depends ()
need net
use dns

were replaced by

depends()
need net dns
Back to top
View user's profile Send private message
ansient
Guru
Guru


Joined: 22 Jan 2005
Posts: 445
Location: Argentina

PostPosted: Thu Jun 23, 2005 8:28 am    Post subject: Reply with quote

javeree_work wrote:
With the explanation above, I still don't see what the consequences would be if

depends ()
need net
use dns

were replaced by

depends()
need net dns

need = must start first, and if the needed service stops then the service that needs it will stop
use = gets started first, but if the used service stops the service that uses it will not stop
Back to top
View user's profile Send private message
javeree_work
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2005
Posts: 84

PostPosted: Tue Jun 28, 2005 2:47 pm    Post subject: ntp-client kicks in too soon [partially SOLVED] Reply with quote

Thanks for the clarification on the difference between need and use.

Back to the original question:
I have changed RC_PARALLEL_STARTUP in /etc/conf.d/rc back to "no", and now the problem has disappeared. Although it is a solution, I think it is still unsatisfactory. The use and need declarations should be honored, even when starting things partially.

By the way, I also just saw that with the new contents of /etc/init.d/net.eth0 there is also a new format for the conf.d file. I have now executed `mv net.example net`, accepting all default values. I doesn't seem to influence the ordering problem though.
Back to top
View user's profile Send private message
kallamej
Administrator
Administrator


Joined: 27 Jun 2003
Posts: 4920
Location: Gothenburg, Sweden

PostPosted: Tue Jul 19, 2005 9:31 am    Post subject: Reply with quote

Moved from Other Things Gentoo to Duplicate Threads in favour of https://forums.gentoo.org/viewtopic-t-347563.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum