1

I have a custom service. I recently ported it to systemd for RHEL7. I usually stop, disable and remove the service file. Is that enough or do I need to do these also

rm /etc/systemd/system/[servicename] symlinks that might be related
systemctl daemon-reload
systemctl reset-failed

from:https://superuser.com/a/936976/82754

epsilon8
  • 730
  • 3
  • 12
  • 22

1 Answers1

0

Firstly, to stop, disable, and remove the service you should use systemctl commands like systemctl stop [servicename], systemctl disable [servicename] and then rm [path to service]. You can also use chkconfig [check here] command but as noted in one of my last answers by a user that this is now an old command and may not be available in newer systems!

Secondly, executing systemctl daemon-reload after the above is a good practice.

Lastly, executing systemctl reset-failed is not mandatory unless you have the service failed before. below is the systemd man page:

reset-failed [PATTERN...]

Reset the "failed" state of the specified units, or if no unit name is passed, reset the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code, terminating abnormally or timing out), it will automatically enter the "failed" state and its exit code and status is recorded for introspection by the administrator until the service is restarted or reset with this command.