下面说说通过rc.local文件进行开机启动

1、首先创建一个启动脚本,这里以启动docker为例

创建 docker-startup.sh 脚本

#! /bin/bash

/usr/bin/mk-docker-opts.sh -c
systemctl daemon-reload
systemctl restart docker

 

并给 docker-startup.sh 设置执行权限:

chmod +x docker-startup.sh

 

2、在 /etc/rc.local 末尾增加 docker-startup.sh 脚本

# vim /etc/rc.local
# 追加到末尾即可
# /root/shell/docker-startup.sh

 

并给 rc.local 设置执行权限

chmod +x /etc/rc.local

 

3、重新启动,验证结果。

相关文章:

  • 2021-12-23
  • 2021-11-11
  • 2022-12-23
  • 2021-10-12
  • 2021-04-23
  • 2021-12-06
  • 2022-12-23
  • 2021-12-07
猜你喜欢
  • 2021-11-20
  • 2021-09-15
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2021-08-03
相关资源
相似解决方案