Forcing start order of init scripts
Dear List, I use NIS to distribute /etc/hosts for lan hostname lookup. This works fine for all but one machine. For some reason, ypbind is not running on that machine until after xntpd tries to resolve my gateway's hostname to get initial time sync. Can I force /etc/init.d/xntpd to wait until ypbind is running? How? Cheers Dylan -- "The man who strikes first admits that his ideas have given out." (Chinese Proverb)
On 7/18/05, Dylan <dylan@dylan.me.uk> wrote:
Dear List,
I use NIS to distribute /etc/hosts for lan hostname lookup. This works fine for all but one machine. For some reason, ypbind is not running on that machine until after xntpd tries to resolve my gateway's hostname to get initial time sync.
Can I force /etc/init.d/xntpd to wait until ypbind is running? How?
Cheers
The order of the init scripts running is controlled by the links in /etc/init.d/rc3.d, etc. They are run in alphabetical order. So S10* is run before S20*, etc. If you need to re-order some scripts, just rename them appropriately. (Be sure not to change the first letter, the S is for Start and K is for Kill. Only S* and K* links get run at startup/shutdown. If you do any renaming, I would go into all of the rc?.d directories and do the same renames. FYI: I don't know how maintainable this solution is, so maybe someone knows a more maintainable solution. Greg -- Greg Freemyer The Norcross Group Forensics for the 21st Century
Greg Freemyer wrote:
I use NIS to distribute /etc/hosts for lan hostname lookup. This works fine for all but one machine. For some reason, ypbind is not running on that machine until after xntpd tries to resolve my gateway's hostname to get initial time sync.
Can I force /etc/init.d/xntpd to wait until ypbind is running? How?
Just edit the line in /etc/init.d/xntpd like ### BEGIN INIT INFO # Provides: named # Required-Start: $network $syslog ypbind # Required-Stop: $network $syslog ypbind Sandy -- List replies only please! Please address PMs to: news-reply (@) japantest (.) homelinux (.) com
On Monday 18 July 2005 20:34, Greg Freemyer wrote:
On 7/18/05, Dylan <dylan@dylan.me.uk> wrote:
Dear List,
I use NIS to distribute /etc/hosts for lan hostname lookup. This works fine for all but one machine. For some reason, ypbind is not running on that machine until after xntpd tries to resolve my gateway's hostname to get initial time sync.
Can I force /etc/init.d/xntpd to wait until ypbind is running? How?
Cheers
The order of the init scripts running is controlled by the links in /etc/init.d/rc3.d, etc.
They are run in alphabetical order.
So S10* is run before S20*, etc.
If you need to re-order some scripts, just rename them appropriately. (Be sure not to change the first letter, the S is for Start and K is for Kill. Only S* and K* links get run at startup/shutdown.
If you do any renaming, I would go into all of the rc?.d directories and do the same renames.
FYI: I don't know how maintainable this solution is, so maybe someone knows a more maintainable solution.
Do a: # chkconfig -d xntpd to remove the existing links edit the /etc/init.d/xntpd and add ypbind to the line that looks like: # Required-Start: $remote_fs $syslog $named then do a: # chkconfig -a xntpd to add the links again. The software will take care of creating all the links and dependancies. You might want to run a diff on the folders to see if you can understand what is different in the files/sequencing of startup. -- Steve Boddy
On Monday 18 Jul 2005 21:08, Stephen Boddy wrote:
Do a: # chkconfig -d xntpd to remove the existing links
edit the /etc/init.d/xntpd and add ypbind to the line that looks like: # Required-Start: $remote_fs $syslog $named
then do a: # chkconfig -a xntpd to add the links again. The software will take care of creating all the links and dependancies.
This worked like a charm, except that I had to make the change in all the scripts whch need name resolution. I notice that each of then has a variable $named in the required start list. Is it possible to arrange for the expansion of that variable to result in "named or ypbind", or somesuch? Cheers Dylan -- "The man who strikes first admits that his ideas have given out." (Chinese Proverb)
Greg Freemyer wrote:
On 7/18/05, Dylan <dylan@dylan.me.uk> wrote:
Dear List,
I use NIS to distribute /etc/hosts for lan hostname lookup. This works fine for all but one machine. For some reason, ypbind is not running on that machine until after xntpd tries to resolve my gateway's hostname to get initial time sync.
Can I force /etc/init.d/xntpd to wait until ypbind is running? How?
Cheers
The order of the init scripts running is controlled by the links in /etc/init.d/rc3.d, etc.
They are run in alphabetical order.
So S10* is run before S20*, etc.
If you need to re-order some scripts, just rename them appropriately. (Be sure not to change the first letter, the S is for Start and K is for Kill. Only S* and K* links get run at startup/shutdown.
If you do any renaming, I would go into all of the rc?.d directories and do the same renames.
FYI: I don't know how maintainable this solution is, so maybe someone knows a more maintainable solution.
You may find that Yast changes the order.
On Mon, 2005-07-18 at 15:34 -0400, Greg Freemyer wrote:
On 7/18/05, Dylan <dylan@dylan.me.uk> wrote:
Dear List,
I use NIS to distribute /etc/hosts for lan hostname lookup. This works fine for all but one machine. For some reason, ypbind is not running on that machine until after xntpd tries to resolve my gateway's hostname to get initial time sync.
Can I force /etc/init.d/xntpd to wait until ypbind is running? How?
Cheers
The order of the init scripts running is controlled by the links in /etc/init.d/rc3.d, etc.
They are run in alphabetical order.
So S10* is run before S20*, etc.
If you need to re-order some scripts, just rename them appropriately. (Be sure not to change the first letter, the S is for Start and K is for Kill. Only S* and K* links get run at startup/shutdown.
If you do any renaming, I would go into all of the rc?.d directories and do the same renames.
FYI: I don't know how maintainable this solution is, so maybe someone knows a more maintainable solution.
If you are using SuSE 9.2 or 9.3 it will not work that way. If you want to reorder the start sequence of the scripts take a look at the beginning of the scripts and look for the Requires: line. This determines which scripts run before others. Simply changes the links will not keep after SuSEconfig is run. P.S. Greg, please only reply to the list. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
On Mon, 18 Jul 2005 15:34:06 -0400, you wrote:
On 7/18/05, Dylan <dylan@dylan.me.uk> wrote:
Dear List,
I use NIS to distribute /etc/hosts for lan hostname lookup. This works fine for all but one machine. For some reason, ypbind is not running on that machine until after xntpd tries to resolve my gateway's hostname to get initial time sync.
Can I force /etc/init.d/xntpd to wait until ypbind is running? How?
Cheers
The order of the init scripts running is controlled by the links in /etc/init.d/rc3.d, etc.
[snippage] Not exactly (as of 9.3). They made batches of the .rc scripts execute in parallel during boot, to speed things up. I haven't had time to work out all of the details of the new mechanism but it's caused several interesting problems... It's the root cause of the 'interface name swapping at boot' problem, for example. Mike- -- Mornings: Evolution in action. Only the grumpy will survive. -- Please note - Due to the intense volume of spam, we have installed site-wide spam filters at catherders.com. If email from you bounces, try non-HTML, non-encoded, non-attachments.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Monday 2005-07-18 at 15:34 -0400, Greg Freemyer wrote:
The order of the init scripts running is controlled by the links in /etc/init.d/rc3.d, etc.
Yesss... Although in a 9.3 that is not so safe to certify.
If you need to re-order some scripts, just rename them appropriately.
No, not in a SuSE system. As long as I have known SuSE (version 5.2), it doesn't work for long, because yast will reorder those links to the "proper" order. The details vary from version to version.
FYI: I don't know how maintainable this solution is, so maybe someone knows a more maintainable solution.
See "man init.d" Seek "The SuSE boot concept" in the SuSE admin book. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFC3u0UtTMYHG2NR9URAm+tAJ90jyaCOtESLSArUq4j8ZskP9VvdgCfe27h Yy9RGbclbSDnls7PKAj1h70= =XBcd -----END PGP SIGNATURE-----
Dylan wrote:
Dear List,
I use NIS to distribute /etc/hosts for lan hostname lookup. This works fine for all but one machine. For some reason, ypbind is not running on that machine until after xntpd tries to resolve my gateway's hostname to get initial time sync.
Can I force /etc/init.d/xntpd to wait until ypbind is running? How?
You can specify prerequisites in the script that runs it.
participants (8)
-
Carlos E. R.
-
Dylan
-
Greg Freemyer
-
James Knott
-
Ken Schneider
-
Michael W Cocke
-
Sandy Drobic
-
Stephen Boddy