chkconfig 命令无效
root@iZ2ze9dhxbd6xwizhjqbloZ:/usr/java# chkconfig
chkconfig: command not found
root@iZ2ze9dhxbd6xwizhjqbloZ:/usr/java#
安装 sysv-rc-conf
root@iZ2ze9dhxbd6xwizhjqbloZ:/usr/java# rpm -aq |grep chkconfig
root@iZ2ze9dhxbd6xwizhjqbloZ:/usr/java# apt-get install sysv-rc-conf
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libcurses-perl libcurses-ui-perl libterm-readkey-perl
The following NEW packages will be installed:
libcurses-perl libcurses-ui-perl libterm-readkey-perl sysv-rc-conf
0 upgraded, 4 newly installed, 0 to remove and 181 not upgraded.
Need to get 367 kB of archives.
After this operation, 1,263 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial/universe i386 libcurses-perl i386 1.33-1build1 [86.6 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial/universe i386 libterm-readkey-perl i386 2.33-1build1 [28.2 kB]
Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial/universe i386 libcurses-ui-perl all 0.9609-1 [229 kB]
Get:4 http://mirrors.cloud.aliyuncs.com/ubuntu xenial/universe i386 sysv-rc-conf all 0.99-7 [22.7 kB]
Fetched 367 kB in 0s (1,348 kB/s)
Selecting previously unselected package libcurses-perl.
(Reading database ... 102296 files and directories currently installed.)
Preparing to unpack .../libcurses-perl_1.33-1build1_i386.deb ...
Unpacking libcurses-perl (1.33-1build1) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../libterm-readkey-perl_2.33-1build1_i386.deb ...
Unpacking libterm-readkey-perl (2.33-1build1) ...
Selecting previously unselected package libcurses-ui-perl.
Preparing to unpack .../libcurses-ui-perl_0.9609-1_all.deb ...
Unpacking libcurses-ui-perl (0.9609-1) ...
Selecting previously unselected package sysv-rc-conf.
Preparing to unpack .../sysv-rc-conf_0.99-7_all.deb ...
Unpacking sysv-rc-conf (0.99-7) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libcurses-perl (1.33-1build1) ...
Setting up libterm-readkey-perl (2.33-1build1) ...
Setting up libcurses-ui-perl (0.9609-1) ...
Setting up sysv-rc-conf (0.99-7) ...
直接加入启动程序,例如把 /etc/init.d/tomcat加入到系统自动 启动列表中:
sysv-rc-conf tomcat on //开启
sysv-rc-conf tomcat off //关闭
centos 跟ubuntu 还是有区别的!
sysv-rc-conf 命令执行效果