Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to delete a systemd service?

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?

How to delete a systemd service?

I haven't reinstalled fedora Fedora for quite a few releases, I have only upgraded. The problem is that some services still appear in systemctl systemctl even though no file exists and they can't be deleted using "systemctl systemctl disable annoyingservice.service"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 themthem:

$ sudo systemctl disable exim.service

But it doesn't workwork:

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

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