I read, that each runlevel has its own set of services or daemons, which can be looked up in /etc/rcX.d (X for the respect runlevel), there are scripts which names start with S and start services of the runlevel, there are also scripts that starts with a K, they are killing-scripts to stop a service from running.

Now, my question points to the fact, that it is possible to enter each runlevel from each other runlevels (2-5). for instance one can enter runlevel 1 from runlevel 2,3,4 or 5. Since each of them have different sets of services, why there is only one set of killing scripts? When I compare /etc/rc1.d and /etc/rc5.d there are services in runlevel 5 for which no killing script exist in runlevel 1. What happens to theese services when transiting runlevels?


You are thinking of this in an incorrect way; the K scripts which are present for instance in runlevel 3 are not meant to be for killing stuff before entering runlevel 3, but when exiting runlevel 3 before entering some other.

So transitioning from runlevel 5 to runlevel 1 would first execute the Kill scripts in /etc/rc5.d (which would match the Start scripts executed when entering there) then the Start scripts in /etc/rc1.d

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.