How to Custom Startup Script in Ubuntu
Written by vaheeD on July 9, 2021
Create your service file:
sudo nano /etc/systemd/system/custom-startup.service
And paste the following template:
[Unit]
Description=Custom Startup
After=network.service
[Service]
ExecStart=/root/startup.sh
[Install]
WantedBy=default.target
If sticking to the example above, create the shell script:
sudo touch /root/startup.sh
sudo chmod +x /root/startup.sh
Next, let systemd know something changed:
sudo systemctl daemon-reload
Then enable and start the service:
sudo systemctl enable custom-startup
sudo systemctl start custom-startup