问题
使用 chkconfig
使能一个服务自启动
root@iZbp1hdp3rovo0jog817s1Z:/etc/nginx# chkconfig --add nginx
chkconfig: command not found
无法找到该命令,自然想到安装该命令
root@iZbp1hdp3rovo0jog817s1Z:/etc/nginx# sudo apt-get install chkconfig
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package chkconfig is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'chkconfig' has no installation candidate
不存在该命令
解决方法
The command chkconfig is no longer available in Ubuntu.The equivalent
command to chkconfig is update-rc.d.This command nearly supports all
the new versions of ubuntu.The similar commands are
update-rc.d <service> defaults update-rc.d <service> start 20 3 4 5 update-rc.d -f <service> remove
翻译一下
命令chkconfig在Ubuntu中不再可用。chkconfig的等效命令是update rc.d
、这个命令几乎支持所有新版本的 ubuntu
。
类似的命令如下:
update-rc.d <service> defaults
update-rc.d <service> start 20 3 4 5
update-rc.d -f <service> remove
参考文档
https://stackoverflow.com/questions/20680050/how-do-i-install-chkconfig-on-ubuntu