ubuntu 20.04 startup script
ubuntu 20.04 startup script
1.Edit rc-local.service
1
sudo vim /lib/systemd/system/rc-local.service
Add [Install] at the end
1
2
3
[Install]
WantedBy=multi-user.target
Alias=rc-local.service
2.Add /etc/rc.local , set first line “#!/bin/sh” and last line is “exit 0”
1
2
3
#!/bin/sh
/home/test.sh
exit 0
3.ln rc-local.service to /etc/systemd/system
1
sudo ln -s /lib/systemd/system/rc-local.service /etc/systemd/system
4.start rc-local service
1
systemctl start rc-local
This post is licensed under CC BY 4.0 by the author.