This discussion is archived
2 Replies Latest reply: Feb 18, 2013 4:47 AM by Zoltan Kecskemethy RSS

chkconfig does not create right symbolic links

CESARDBAIBM Newbie
Currently Being Moderated
Hello all,

I am just adding a script to automate start / stop during Oracle Linux reboot. I figured out that the symbolic links are not created in the right order. To prove that, I create a small script for test purposes.

=====================================================
# #!/bin/sh
# Name: init.test
# chkconfig: 45 80 20
# description: Script test for chkconfig
#
echo "This is a test script only. chkconfig is not creating correct symbolic links."
=====================================================

Then I used chkconfig --add init.test

It should be created entries for levels 4-5 only, but it creates more soft links in rc.d directories.

find /etc -name "*init.test" | sort
/etc/rc.d/init.d/init.test
/etc/rc.d/rc0.d/K20init.test
/etc/rc.d/rc1.d/K20init.test
/etc/rc.d/rc2.d/K20init.test
/etc/rc.d/rc3.d/K20init.test
/etc/rc.d/rc4.d/S80init.test
/etc/rc.d/rc5.d/S80init.test
/etc/rc.d/rc6.d/K20init.test

Even that chkconfig show the correct levels, I am just curious why it created more kill soft links in rc.d directories.
chkconfig --list init.test
init.test      0:off     1:off     2:off     3:off     4:on     5:on     6:off

Someone could try to explain to me why the kill script has been added to runlevel 0, 1, 2, and 6? Am I missing something here?

Appreciate your help on this.
Cesar

Edited by: CESARDBAIBM on Feb 18, 2013 2:43 AM
  • 1. Re: chkconfig does not create right symbolic links
    Dude! Guru
    Currently Being Moderated
    I don't see anything wrong here. CHKCONFIG added kill scripts to all INIT run levels, which is what you want to support switching of run levels. For instance, if you switch from init 5 to init 1 it should shutdown Oracle because you did not specify that Oracle should be started at run level 1, only 4 and 5.
  • 2. Re: chkconfig does not create right symbolic links
    Zoltan Kecskemethy Expert
    Currently Being Moderated
    see
    man chkconfig
    where you can find a good example including explanation
           For example, random.init has these three lines:
           # chkconfig: 2345 20 80
           # description: Saves and restores system entropy pool for \
           #              higher quality random number generation.
           This says that the random script should be started in levels 2,  3,  4,
           and 5, that its start priority should be 20, and that its stop priority
           should be 80.  You should be able to figure out  what  the  description
           says;  the \ causes the line to be continued.  The extra space in front
           of the line is ignored.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points