This is caused by the rc-default script, which invokes the default runlevel once the rcS job has stopped.
It does this by a combination of grep on the command-line and /etc/inittab files, then invoking telinit with whatever argument it found.
It only handles -s/single/S being on the command line, because that's all I knew about at the time -- it would need patching/modifying to also look for the other runlevel names and set $RL appropriately.
This is caused by the rc-default script, which invokes the default runlevel once the rcS job has stopped.
It does this by a combination of grep on the command-line and /etc/inittab files, then invoking telinit with whatever argument it found.
It only handles -s/single/S being on the command line, because that's all I knew about at the time -- it would need patching/modifying to also look for the other runlevel names and set $RL appropriately.