How to disable auto-restart in systemd .service files

Viewed 2688

I want to disable a systemd service auto-restart after it crashes. I did some search and I found that "Restart" property of .service files has some options, but none of them does not mean "disable". Could anyone help please?

1 Answers

If you don't want the service to start after crash, delete the Restart option of the service file. Then run:

systemctl daemon-reload

An enabled service is a service that starts at boot. To disable start at boot run:

sudo systemctl disable <service_name>
Related