开机启动与禁止

1.  update-rc.d

使用命令“ update-rc.d -f mysql remove “可移除mysql的自启动服务。

linux系统重启之后发现mysql服务没有随机启动。

使用”update-rc.d mysql defaults“可以将mysql添加到随机启动项里。

2. chkconfig

linux chkconfig添加开机启动服务

3. systemctl

systemctl原流行于CentOS/Fedora/Redhat一系,后面debian/ubuntu也采用这种服务管理方式。

systemctl is-enabled servicename.service #查询服务是否开机启动
systemctl enable *.service #开机运行服务
systemctl disable *.service #取消开机运行
systemctl start *.service #启动服务
systemctl stop *.service #停止服务
systemctl restart *.service #重启服务
systemctl reload *.service #重新加载服务配置文件
systemctl status *.service #查询服务运行状态

posted @ 2015-11-20 21:53  PKICA  阅读(205)  评论(0编辑  收藏  举报