In Redhat/CentOS, there is one line in the init script which looks like
# chkconfig: - 65 10
If you use --add when the first arg of above line is "-", this adds no start links, only the kill links. So for --add to work, you have to edit the init script and change to e.g.
# chkconfig: 345 65 10
But if chkconfig --add ... was executed with the "-" as first arg (which is mostly the case from rpm post script):
Changing afterwards the first arg and reexecute chkconfig --add has no effect as long as the
kill links are present. In this case --list shows off for all runlevel:
Which OS are you running? If you run chkconfig with only a service name as an argument, I believe RHEL's chkconfig simply checks if that service is set to run at which ever run level you are currently running (said Dr. Suess).
chkconfig --add
adds a new service to the list of services managed bychkconfig
. I believe--add
is an impliciton
.chkconfig on
sets the runlevel for the service.That said, I tend to use
chkconfig -add
for adding new services to a system, butntsysv
to manage them (on RHEL-like systems).In Redhat/CentOS, there is one line in the init script which looks like
If you use --add when the first arg of above line is "-", this adds no start links, only the kill links. So for --add to work, you have to edit the init script and change to e.g.
But if chkconfig --add ... was executed with the "-" as first arg (which is mostly the case from rpm post script): Changing afterwards the first arg and reexecute chkconfig --add has no effect as long as the kill links are present. In this case --list shows off for all runlevel:
To make --add work in this case, you first have to use --del, then the output of --list is:
Now you can use --add and it has the desired effect.
Alternatively you can use "on" with the --level argument to avoid the need of editing the init script and to avoid first --del followed by --add.
Which OS are you running? If you run chkconfig with only a service name as an argument, I believe RHEL's chkconfig simply checks if that service is set to run at which ever run level you are currently running (said Dr. Suess).