setup systemd service file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| sudo vi /etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
|
enable systemd service
1
| sudo systemctl enable rc-local
|
create rc.local
1
2
3
4
5
6
7
| sudo vi /etc/rc.local
#!/bin/bash
...
sudo chmod +x /etc/rc.local
|