vaheeD khoshnouD

linux, mikrotik, macosx

How to Custom Startup Script in Ubuntu

Written by vaheeD on July 9, 2021
0.00 avg. rating (0% score) - 0 votes

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

0.00 avg. rating (0% score) - 0 votes

Posted Under: Linux

About vaheeD

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected by WP Anti Spam