System Administration
Showing results for 
Search instead for 
Did you mean: 

Re: Does NIC (network services) come up first

Super Advisor

Does NIC (network services) come up first

I have a two node Oracle RAC running SLES 10 SP2 on itanium.

how do i make sure the NICs are the ones which come up first followed by NTP and then the Oracle RAC clusterware?
i v read articles like the following

but i am confused as to how the scripts will behave
Honored Contributor

Re: Does NIC (network services) come up first

The article you mentioned gets the basic principles right, but there are certain distribution-specific differences in startup script paths.

Perhaps a SLES 10-specific document is more useful here:

Look at the "Troubleshooting Table".

Once the bootloader has done its job, the kernel has started and all the initial boot scripts embedded in the initrd have been completed, the root filesystem will be mounted and the real "init" process is started. This is at step 7 of the Troubleshooting Table.

At step 8, init runs /etc/init.d/boot, which is a script. It runs all the files it can find in /etc/init.d/boot.d, in alphanumerical order (= the same order they are listed by regular "ls" command).

At step 9, /etc/init.d/boot.local is run. Simple.

At step 10, init begins to switch the system to the default runlevel (usually 3 or 5). Most of the work is done by...

...step 11, in which the script /etc/init.d/rc runs the scripts found in the directory corresponding to the runlevel of choice (usually /etc/init.d/rc3.d or /etc/init.d/rc5.d, respectively).

The runlevel-specific directories follow SysVinit conventions: they contain only symbolic links referring to scripts in the main startup/shutdown script directory, /etc/init.d. The link names begin with either letter K or letter S: then there will be two numbers, and then the name of the script.

First, the /etc/init.d/rc script looks for scripts whose name begins with K. If those are found, the script runs them in alphanumeric order, with argument "stop".
Then, the scripts whose name begins with S are run in the same way, but with argument "start".

In SLES 10 and newer, the links in the /etc/init.d/rc?.d directories are created and updated automatically by insserv. It assigns the numbers in the link names so that the scripts are run in the proper order. The ordering is determined by the "INIT INFO" comment block at the beginning of the script.

Here's an example INIT INFO block for service FOO, whose actual startup/shutdown script would be located in /etc/init.d/foo:

# Provides: FOO
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start FOO to allow XY and provide YZ

This information is used by insserv to assign the numbers in the /etc/init.d/rc?.d links, so that /etc/init.d/rc will run them in the proper order.

In this example, the Required-Start and Required-Stop fields say that when service FOO is started or stopped, the services "syslog" and "remote_fs" must be running.

In other words:

- when starting the system, "/etc/init.d/foo start" can be run only after services whose INIT INFO contains "Provides: syslog" and "Provides: remote_fs" are already started successfully.

- when stopping the system, "/etc/init.d/foo stop" must be run before services whose INIT INFO contains "Provides: syslog" and "Provides: remote_fs" are stopped.

To make sure NTP is started after networking, the startup script for NTP should specify "Required-Start: $network". If you're using the distribution's standard NTP package, this is probably already included in the scripts by default.

To make sure Oracle RAC clusterware is started only after NTP, you may have to write the correct INIT INFO block for it yourself. Look at the NTP start-up script and find the "Provides:" keyword in its INIT INFO block. Then specify that keyword (prefixed with $) in the "Required-Start:" line of the Oracle RAC clusterware start-up script.

After that, you should use the insserv command to automatically generate/update the appropriate links in /etc/init.d/rc?.d directories.

Run "man insserv" to see more information about the insserv command and the INIT INFO blocks.

In latest Linux distributions, the /etc/init.d/rc?.d directories are not actually used at all (although they might still exist for backward compatibility): instead, the INIT INFO blocks are used to determine the dependencies between various scripts, allowing the start-up system to run multiple scripts in parallel whenever possible. As multi-core CPUs are becoming common even in laptops, this should greatly improve system start-up times.

Super Advisor

Re: Does NIC (network services) come up first

thank you for that detailed response Matti.
I will read the article you have provided and also go through sles manual again.
thank you.