[Linux] ubuntu 20.04 exec program after boot
In Ubuntu 20.04
, Can’t Find rc.local
File.
Just Hide, Find It Now~
Step 1
Go To /lib/systemd/system
Path And Edit rc-local.service
vim /lib/systemd/system/rc-local.service
Add These In Last Line
[Install]
WantedBy=multi-user.target
Alias=rc-local.service
Step 2
Add File rc.local
In /etc/
vim /etc/rc.local
Look Like This
#!/bin/bash
<Put Your Script/Program Here>
exit 0
Don’t Forget Give It Exec Permission
chmod +x /etc/rc.local
Step 3
Use ln -s
Link Service File
ln -s /lib/systemd/system/rc-local.service /etc/sysstemd/system/rc-local.service
Step 4
Make Service Start After Boot
systemctl enable rc-local
Step 5
Try It!!
reboot