In what sequence startup and shutdown RC scripts are executed in Solaris

We can use RC (Run Control) scripts present in /etc/rc* directories to start or stop a service during bootup and shutdown.

Each rc directory is associated with a run level. For example the scripts in rc3.d will be executed when the system is going in Run Level 3.

All the scripts in these directories must follow a special pattern so that they can be considered for execution.

The startup script file starts with a “S” and kill script start with a “K”. The uppercase is very important or the file will be ignored.

The sequence of these startup and shutdown script is crucial if the applications are dependent on each other.

For example while booting up a database should start before application. While during shutdown the application should shutdown first followed by Database.

Udemy

Here we will see how we can sequence these scripts.

So as given in below example during startup S90datetest.sh script was executed first and than S91datetest.sh .

Time during execution of CloudVedas script S90datetest.sh is Monday, 23 September 2016 16:19:43 IST
Time during execution of CloudVedas script S91datetest.sh is Monday, 23 September 2016 16:19:48 IST

 

Similarly during shutdown K90datetest.sh script was executed first and then K91datetest.sh .

Time during execution of CloudVedas script K90datetest.sh is Monday, 23 September 2016 16:11:43 IST
Time during execution of CloudVedas script K91datetest.sh is Monday, 23 September 2016 16:11:48 IST

This sequencing is also a trick interview question and it confuses many people.

Leave a Reply

Your email address will not be published. Required fields are marked *