One day, you need to run chkconfig. The command still cannot be found during root login.
[Root @ localhost ~] # Chkconfig
Bash: chkconfig: Command not found
Why, first check if chkconfig has been installed?
[Root @ localhost ~] # Rpm-Q chkconfig
Chkconfig-1.3.30.1-2
Yes. Where has it been installed?
[Root @ localhost ~] # Whereis chkconfig
Chkconfig:/sbin/chkconfig/usr/share/man/man8/chkconfig.8.gz
/Sbin/chkconfig here, why not recognize the command and check the environment variables?
[Root @ localhost ~] # Echo $ path
/Usr/Kerberos/sbin:/usr/Kerberos/bin:/usr/local/bin:/usr/bin:/home/zhaoxueqian/bin
The/sbin directory is not found. Add the Directory and search a bunch of files online.
[Root @ localhost ~] # Export Path = $ path:/sbin/
Try chkconfig again
[Root @ localhost ~] # Chkconfig
Chkconfig version 1.3.30.1-copyright (c) 1997-2000 red hat, Inc.
...
That is, understanding.