Nicholas M. Salvatore

Back arrow

Safely remove systemd service and timer

First, stop the service and timer from running.

$ sudo systemctl stop service-name.service
$ sudo systemctl stop service-name.timer

Next, disable them so that they don't automatically start at boot.

$ sudo systemctl disable service-name.service
$ sudo systemctl disable service-name.timer

Check the status to make sure they aren't still active.

$ sudo systemctl status service-name.service
$ sudo systemctl status service-name.timer

Remove the service and timer files. Double check to make sure the path to the files is correct!

$ sudo rm /etc/systemd/system/service-name.service
$ sudo rm /etc/systemd/system/service-name.timer

After removing the service and timer files, reload the systemd daemon to refresh its state and remove references to the deleted units.

$ sudo systemctl daemon-reload