ubuntu 18 添加开机启动命令

Monday, Dec 28, 2020 | 1 minute read | Updated at Monday, Dec 28, 2020

@

ubuntu 18 添加开机启动命令,代码如下

vi /lib/systemd/system/rc.local.service 
//在文件末尾添加下面代码
[Install]
WantedBy=multi-user.target
Alias=rc-local.service



ln -s /lib/systemd/system/rc.local.service /etc/systemd/system/rc.local.service
chmod +x /etc/rc.local

/etc/rc.local文件内容如下

#!/bin/bash
echo "time" > /temp/test.log
/etc/init.d/ssh start
其它命令
exit 0

© 2018 - 2026 vpslala

🌱 Powered by Hugo with theme Dream.