Unix Run Levels confusion

Hi,

Could somebody throw some light on the below queries:

  • For a run-level X, the S* scripts are executed when coming here from X-n run-level. The K* scripts are executed when coming to X runlevel from X+n runlevel.
  • Does reaching to runlevel X from X-3 executes K* scritps from X-2 & X-1 also or it directly reaches X runlevel. Vice-versa of executing S* scripts while reaching X runlevel from X=3 runlevel.

Are the above true for all Unix variants or different?

Thanks

I suppose it depends on how implemented in OS, e.g HPUX will going from init 4 to 2 execute the KXXX of 3, doing a init 1 from 3 on solaris will not run Kyyy of 2...

It is not the same on every unix. Many don't have runstate 6 (reboot) for example.

Explanation is in "man rc" on the system.

/etc/rc is actually a script which you can read.

Okie,

I'll go through "man rc"

My mistake. On modern systems the script is /sbin/rc !