ubuntu没有rc.local文件----ubuntu怎样设置开机启动项
说明:ubuntu从16.10就没有rc.local这个文件了,自己创建就可以
root@v2ray-tw:~# touch /etc/rc.local
增加可执行权限
root@v2ray-tw:~# chmod a+x /etc/rc.local
编写文件,在exit 0之前加入需要执行的语句即可。
注意:不要加入死循环的执行语句,如果已经发生系统无法系统可以进单用户模式进行操作。
#!/bin/sh -e # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. docker start centos-bt docker start centos7-v2ray exit 0
如上为我加入的docker容器开机启动
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。