admin avatar

ubuntu 18 添加开机启动命令

🕒 by admin





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

1
2
3
4
5
vi /lib/systemd/system/rc.local.service 
//在文件末尾添加下面代码
[Install]
WantedBy=multi-user.target
Alias=rc-local.service
1
2
ln -s /lib/systemd/system/rc.local.service /etc/systemd/system/rc.local.service
chmod +x /etc/rc.local
/etc/rc.local文件内容如下

Bash:
1
2
3
4
5
#!/bin/bash
echo "time" > /temp/test.log
/etc/init.d/ssh start
其它命令
exit 0





写一条评论

Based on Golang + fastHTTP + sdb | go1.18.3 Processed in 1ms