Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Why do scripts beginning with an 'S' exist in /etc/rc.d/rc{0,6}.d? Will there be trouble if I change the 'S' to a 'K'?

Is the behavior of the system changed when it halts/reboots?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Yes, the traditional system V init style (what that is) makes symlinks that start with S, or K. those with S means "start", and they are run with the "start" parameter when that runlevel is entered. Those with K means "kill", those services are run with the "stop" parameter when that runlevel is entered. This makes the different run levels have different sets of services running. If you cange one from S to K the server won't be started, it will be stopped then. That may or may not be a problem depending on whether or not it was a critical service.

BTW, this method is being obsoleted by newer, dependency based startup systems in newer Linux distros.

share|improve this answer
    
I mean changing a link in rc0.d or rc6.d, will this change the behavior of the system? –  TheoYou Jul 10 '11 at 12:29
    
Why don't you elaborate on your original question so we don't have to guess what you really mean? Thanks. –  Keith Jul 10 '11 at 12:33
1  
I think in both of those it doesn't make sense to have any "S" scripts since 0 is shutdown and 6 is reboot. Runlevels 0 and 6 aren't normally "exited from." If you want to disable a script from running on shutdown or reboot the right thing to do is remove the symlink. If you want to change the order it executes, you want to "rename" the symlink to modify the two digit number, i.e. change K10whatever to K20whatever. You should consult the script itself to know what it actually does. –  ultrasawblade Jul 10 '11 at 14:01
    
This is a really bad answer. The OP was specifically asking about the implication of having a start script in the shutdown/restart directory. –  aaa90210 Jul 9 '13 at 0:01
    
@aaa90210 No, he wasn't. –  Keith Jul 10 '13 at 0:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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