Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

1. 拷贝或创建软链接 -> /etc/systemd/system

sudo cp /lib/systemd/system/rc-local.service /etc/systemd/system

2. 编辑 rc-local.service 文件,增加如下内容:

[Install]  
WantedBy=multi-user.target
Alias=rc-local.service

3. 创建/etc/rc.local

#!/bin/sh

/home/zouni88/dns/alidns dns &

4. 增加可执行权限

chmod +x /etc/rc.local

最后测试

启动

systemctl start rc-local.service

查看状态

system status rc-local.service