Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing runlevel with init 1

Status
Not open for further replies.

martvar

Programmer
Jan 10, 2005
19
SK
When init is requested to change the runlevel, it sends the warning signal SIGTERM to all processes that are undefined in the new runlevel. It then waits 5 seconds before forcibly terminating these processes via the SIGKILL signal.
Is it ensured that this is done after all scripts with K prefix
are executed in rcn.d, where n is the number of new runlevel?
 
I'm not sure about this, but I think init will only ever kill processes it knows about directly, i.e. those mentioned specifically in /etc/inittab. Otherwise it relies on the /etc/init.d/rc script running all of the correct /etc/rc?.d/KNNxxxx scripts to stop the appropriate services.

Annihilannic.
 
As in man page for init:
"When init is requested to change the runlevel, it sends the warning signal SIGTERM to all processes that are undefined in the new run-level."
In inittab I can see just one entry for runlevel 0:
l0:0:wait:/etc/rc.d/rc 0

So, it calls rc script with parameter 0
and sends SIGTERM signal for other processes running.
So it looks that some processes are stopped by
kill scripts in rc0.d, others directly by init.
But I don't know if is assured that init will not
kill any process before running kill scripts in rc0.d directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top