What is the default runlevel assigned when you run

chkconfig --add

for a program?


chkconfig doesn't change default run levels. That's defined by /etc/inittab (pre-systemd) or systemctl set-default (on systemd).

What chkconfig does is create links to various run levels.

So let's take RedHat 6 (CentOS 6).

When you do chkconfig -add myservice then it will look in /etc/init.d/myservice for specific comment lines:


# chkconfig: 2345 55 25

The 2345 part means the service will be enabled at run levels 2,3,4 and 5. So now chkconfig --add will create links S55myservice in rc[2345].d and K25myservice in the other run levels (rc[016].d)

  • Ohhh, ok. Thanks Stephen, appreciate your knowledge! – chromechris Sep 14 '16 at 23:08
  • Actually, the a script present under /etc/init.d does not contain a "chkconfig" line in it. In this case, is what runlevel is assigned to this program? – chromechris Sep 14 '16 at 23:12
  • On CentOS6 that'll create S50 scripts for 2,3,4,5 and K50 for 0,1,6 – Stephen Harris Sep 14 '16 at 23:20

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.