When init changes to a certain runlevel, it executes all scripts starting with S in the /etc/rc<x>.d/ directory
Actually - it does whatever the /etc/inittab
files says it should do for the new level. That is usually
to run the /etc/init.d/rc
script with the new level as the parameter and it is this script that runs the init.d scripts.
2/ If want to know the current runlevel do echo $RUNLEVEL
Not set for me.
works (edit:) as does the simpler