I am using chkconfig to manipulate runlevel links on my Debian System (LSBInitScripts). I have noticed some inconsistencies, for example

According to chkconfig, the script umountiscsi.sh is turned off in all runlevels:

chkconfig umountiscsi.sh --list
umountiscsi.sh            0:off  1:off  2:off  3:off  4:off  5:off  6:off

however, I can see the symlinks in /etc/rc1.d/ and /etc/rc6.d/

ls -lAhF /etc/rc{1,6}.d/*umountiscsi.sh
lrwxrwxrwx 1 root root 24 Jul 23 13:38 /etc/rc1.d/K01umountiscsi.sh -> ../init.d/umountiscsi.sh*
lrwxrwxrwx 1 root root 24 Jul 23 13:38 /etc/rc6.d/K01umountiscsi.sh -> ../init.d/umountiscsi.sh*

the symlinks in rc1.d and rc6.d mean, that this script will be run in runlevel 1 and 6 (which is the way it is supposed to be run). But why does chkconfig not display it correctly ?

  • 2
    I believe chkconfig only checks for the link scripts that start with S to mark then on. – BitsOfNix Jul 23 '13 at 12:49
  • 1
    does it mean then, that I cannot use chkconfig to manage K init scripts (runlevels 0 and 6)? – Martin Vegter Jul 24 '13 at 5:41
  • chkconfig is telling you the truth. According to what ls says, umountiscsi is not started in any runlevel, which is exactly what chkconfig says. What would you like chkconfig to report differently than it is? – msw Jul 24 '13 at 9:39
  • In my understanding, according to ls, the script umountiscsi is being run (started) in runlevels 1 and 6. So I would have expected that chkconfig reports 1:on and 6:on. – Martin Vegter Jul 24 '13 at 13:19
  • Your understanding is mistaken: the K?? links stop umountiscsi if it is running at the transition to runlevels 1 and 6. Please comment on my answer if there is something unclear there. – msw Jul 25 '13 at 12:09

From /etc/rc?.d/README:

To disable a service in this runlevel, rename its script in this directory so that the new name begins with a 'K' and a two-digit number, and run 'update-rc.d script defaults' to reorder the scripts according to dependencies.

Files starting with S are started, and those with K are killed if running prior to the runlevel switch. This is why there is a K type, it stops something that may be running instead of doing nothing which would happen if there was no [SK]??unmountiscsi.sh present.

  • thanks, I understand the meaning of S and K init scripts. My question was more about how to use chkconfig to manage K scripts in runlevels 0 and 6. – Martin Vegter Jul 24 '13 at 5:37

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.