问题原文
原帖链接 · afarley · CC BY-SA 4.0
What is the systemd-approved method for removing e.g. sidekiq.service from /etc/systemd/system/?
Note, there are many related discussions on this topic such as this one which I have already read: https://superuser.com/questions/513159/how-to-remove-systemd-services
My point of confusion is that the most-accepted answer in the above discussion requires the user to manually rm files from a bunch of locations, but a later answer suggests that systemctl disable <service> should have the same effect as manually removing the files.
According to my own testing of systemctl disable sidekiq, I am finding that the unit file sidekiq.service remains at /etc/systemd/system afterwards.
I understand that, in theory, using rm on a bunch of locations should do the trick, but I'm wondering how someone who is actually familiar with systemd or systemctl would do this. Is such brute force really necessary, or is there an actual systemctl command for this purpose?
已采纳解答
原帖链接 · Michael Hampton · CC BY-SA 4.0
If you're trying to uninstall software, then removing the file is the correct approach. But remember that systemd will remember the service until told to reload its configuration with systemctl daemon-reload. Then it will notice the unit is gone, and (if the service isn't still running) forget about it.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
