Jun
Jun

Reputation: 1

Symlink is missing for init script on Suse

I have an init script called foo which follows the /etc/init.d/skeleten instructions. For example, it has a comment line of # chkconfig: 345 63 37 and comment block of INIT INFO. The script is packaged by rpm. The server is a Linux vm of SLES 11 SP3. The problem is when the vm reboots, the script does not get executed. Here is what I've found.

  1. foo appears in both /etc/init.d and /etc/rc.d
  2. "who -r" command shows the system runlevel is 3
  3. foo does not have any symlink in /etc/rc.d/rc3.d (as chckconfig comment lists the runlevel of foo should be 3 4 5)
  4. The /var/log/boot.msg log file does not contain any entry about foo

In my understanding the reason that foo does not run during start up process is the missing symlink in /etc/rc.d/rc3.d. Some posts mentioned the comment # chkconfig: 345 63 37 should guarantee the creation of symlink but I was not clear why and how. Does anyone have any ideas about how to solve this problem? Thanks.

Upvotes: 0

Views: 483

Answers (1)

Bayleef
Bayleef

Reputation: 195

This may be a dumb answer but if the script was made correctly all you should have to do is

chkconfig -add service

chkconfig -level (0123456) service (on/off)

That should automatically make the symlink

if not just use

ln -s /path/to/service/ /path/to/run/level

Although this is not recommended as it causes you to maintain these manually

Upvotes: 1

Related Questions