Ask Your Question

How to delete a systemd service?

asked 2014-07-09 10:56:16 -0600

javiertury gravatar image

updated 2014-07-09 16:39:26 -0600

I haven't reinstalled Fedora for quite a few releases, I have only upgraded. The problem is that some services still appear in systemctl even though no file exists and they can't be deleted using systemctl disable annoyingservice.service:

$ systemctl -t service --all | grep not-found
exim.service                        not-found inactive dead    exim.service
halt.service                        not-found inactive dead    halt.service
lvm2-activation-early.service       not-found inactive dead    lvm2-activation-early.service
lvm2-activation.service             not-found inactive dead    lvm2-activation.service
ntpd.service                        not-found inactive dead    ntpd.service
oxenstored.service                  not-found inactive dead    oxenstored.service
postfix.service                     not-found inactive dead    postfix.service
reboot.service                      not-found inactive dead    reboot.service
shutdown.service                    not-found inactive dead    shutdown.service
sntp.service                        not-found inactive dead    sntp.service
systemd-random-seed-load.service    not-found inactive dead    systemd-random-seed-load.service
systemd-timesyncd.service           not-found inactive dead    systemd-timesyncd.service

Trying to delete them:

$ sudo systemctl disable exim.service

But it doesn't work:

$ systemctl -t service --all | grep exim
exim.service                        not-found inactive dead    exim.service

Also systemctl daemon-reload does nothing and masking the service it is just a patch, does anybody know how to properly solve this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-09 13:35:39 -0600

hedayat gravatar image

After examining my own system, I was able to identify the problem. Even on my system (I always do a fresh install rather than an update), there are a number of 'not-found' services such as ntpd.service. After examining the situation, I found that actually there is nothing about these services to be solved! These services doesn't exist, really!

So, why systemctl knows about some non-existant ntpd.service? Because the name of this service is listed by some other service as its dependency/conflict/... . For example:

[root@hedayatlap test]# grep ntpd.service /etc/systemd/ /usr/lib/systemd/ -R
/etc/systemd/system/ sntp.service ntpd.service
/etc/systemd/system/ systemd-timesyncd.service
/usr/lib/systemd/system/chronyd.service:After=ntpdate.service sntp.service ntpd.service
/usr/lib/systemd/system/chronyd.service:Conflicts=ntpd.service systemd-timesyncd.service

Therefore, there is really nothing to fix, except by removing some other services which mentioned those 'not-found' services if they are not needed.

edit flag offensive delete link more


Thanks, in that case I suppose there is nothing to worry about

javiertury gravatar imagejaviertury ( 2014-07-09 16:30:24 -0600 )edit

Question Tools


Asked: 2014-07-09 10:56:16 -0600

Seen: 15,117 times

Last updated: Jul 09 '14