Chinaunix首页 | 论坛 | 博客
  • 博客访问: 744346
  • 博文数量: 239
  • 博客积分: 60
  • 博客等级: 民兵
  • 技术积分: 1045
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-22 18:25
文章分类

全部博文(239)

文章存档

2019年(9)

2018年(64)

2017年(2)

2016年(26)

2015年(30)

2014年(41)

2013年(65)

2012年(2)

分类: 系统运维

2019-02-26 21:10:22

1) sudo sysv-rc-conf

2)systemctl

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 #查询服务运行状态

3) 添加自自动

vim new_servers.sh

sudo chmod 755 new_service.sh

sudo mv new_service.sh /etc/init.d/

cd /etc/init.d/

sudo update-rc.d new_service.sh defaults 90


ref: 

ref: https://blog.csdn.net/qq_21904665/article/details/79297832

阅读(1663) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~