Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a systemd service that doesn't start on reboot?

I want to create a systemd service which I can start manually by using systemctl start but I don't want it to run automatically when the system reboots. How do I do this?

like image 255
babueverest Avatar asked Mar 20 '17 10:03

babueverest


1 Answers

When you configure the systemd service, to make it start on boot you'll have to enable it by running:

[sudo] systemctl enable myservice

If you don't enable it, it won't start on boot but you'll still be able to start it manually by running:

[sudo] systemctl start myservice

If a service is already enabled and you want to disable it from running on boot:

[sudo] systemctl disable myservice

Remember to run reload the systemd daemon after changing the config and enabling/disabling services:

[sudo] systemctl daemon-reload
like image 151
nir0s Avatar answered Oct 10 '22 21:10

nir0s