I put one script in
/etc/init.d/abc.sh. Now I want it to run at startup.
How can I do that with chkconfig?
chkconfig --add abc.sh
But I am not sure how it works.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Have a look at other, existing init-scripts. In every proper rh-style init-script there are three hints: the runlevels, where the script should be started and the priority at which it should be started/stopped. The sum of start+stop should be normally 100.
This comment-line is evaluated by chkconfig.
You are on the right track. Your bash script is in the right location and you have added it to your chkconfig, which means your script is installed.
Please note that
/etc/init.d is a symbolic link to
After adding your script, you need to select which runlevel you want to activate it on:
chkconfig --level 35 abc on will activate your script on runlevels 3 and 5, your most common startups.
chkconfig --help for more info.
PS. you can also use
ntsysv which is a tui for chkconfig.