Operating System - HP-UX
1834902 Members
3235 Online
110071 Solutions
New Discussion

will init 3 execute scripts in rc3.d if system is already in run level 3

 
SOLVED
Go to solution
Colin Jensen
Occasional Advisor

will init 3 execute scripts in rc3.d if system is already in run level 3

This question pertains to an RP5470 running B11.11. If the system is currently in a given run level, say run level 3. And the command 'init 3' is run. Does unix run all the scripts in rc3.d, or does unix realize that it is already in run level 3, and does not execute the scripts? Thanks.
5 REPLIES 5
Jeff Schussele
Honored Contributor

Re: will init 3 execute scripts in rc3.d if system is already in run level 3

Hi Colin,

Good question...
I think that it won't run them *again*.
You'd have to run them manually.
But I've not tested that before...

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Patrick Wallek
Honored Contributor
Solution

Re: will init 3 execute scripts in rc3.d if system is already in run level 3

HP-UX knows what run-level it is currently at (do a 'who -r' to see) so I think if you were to do an 'init 3' it would not have any effect. If you had something in /sbin/rc4.d and did an 'init 4' while in run-level 3, then the rc4.d stuff would run.
Patrick Wallek
Honored Contributor

Re: will init 3 execute scripts in rc3.d if system is already in run level 3

OK, I just tested this on my C3000 workstation.

I was at run-level 3. At the prompt I did an '/sbin/init 3' and watched my console window. Nothing happened. No ouput. Nothing.

I then did an '/sbin/init 4' and again watched the console windows and saw:

INIT: New run level: 4

Transition to run-level 4 is complete.


So, doing an 'init same_run_level_you_are_currently_at' will have absolutely no effect.
A. Clay Stephenson
Acclaimed Contributor

Re: will init 3 execute scripts in rc3.d if system is already in run level 3

The key line from the init man page is:
"When init transitions into a NEW run level 0-6, the master sequencer script rc is invoked. Rc, in turn, invokes each of the start or kill scripts."

Because there is no transition to a new run-level, rc is never invoked.
If it ain't broke, I can fix that.
Colin Jensen
Occasional Advisor

Re: will init 3 execute scripts in rc3.d if system is already in run level 3

Thanks everyone. I've assigned points.