remove systemd service 1

remove systemd service

# My recipe for systemd service obliteration
systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] # and symlinks that might be related
rm /usr/lib/systemd/system/[servicename] 
rm /usr/lib/systemd/system/[servicename] # and symlinks that might be related
systemctl daemon-reload
systemctl reset-failed

Here is what the above code is Doing:
1. Stop the service
2. Disable the service
3. Remove the service file
4. Remove the service file symlinks
5. Remove the service file from /usr/lib/systemd/system
6. Remove the service file symlinks from /usr/lib/systemd/system
7. Reload the systemd daemon
8. Reset the failed services

Similar Posts