添加一个ubuntu的开机启动服务
分为以下几个步骤:
1)新建一个脚本文件 new_services.sh

#!/bin/bash
# command content
exit 0

2)设置权限

sudo chmod +x new_services.sh

3)将脚本放置到启动目录下

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

4)将脚本添加到启动脚本

cd /etc/init.d/
sudo update-rc.d new_serviecs.sh defaults 90

这里90表明一个优先级,越高表示执行的越晚。

移除ubuntu开机脚本

sudo update-rc.d -f new_services.sh remove

 



相关文章:

  • 2022-12-23
  • 2021-05-07
  • 2021-08-20
  • 2022-12-23
  • 2022-01-19
  • 2021-12-08
  • 2022-12-23
猜你喜欢
  • 2021-12-23
  • 2021-12-23
  • 2022-02-24
  • 2021-08-01
  • 2022-12-23
  • 2021-12-09
  • 2021-09-15
相关资源
相似解决方案