Most systemd
services can be managed via the systemctl
utility. In this case, we want to disable the systemd-oomd
service. This can be done with:
$ systemctl disable --now systemd-oomd
You should see something like (depending on your OS):
$ systemctl disable --now systemd-oomd
Removed /etc/systemd/system/multi-user.target.wants/systemd-oomd.service.
Removed /etc/systemd/system/dbus-org.freedesktop.oom1.service.
You can then verify that the service is disabled, with:
$ systemctl is-enabled systemd-oomd
And you should then see:
$ systemctl is-enabled systemd-oomd
disabled
It is possible, however, that other services might attempt to restart the systemd-oomd
service. To prevent this, you can 'mask' the service. For example:
$ systemctl mask systemd-oomd
Created symlink /etc/systemd/system/systemd-oomd.service → /dev/null.
And then systemctl is-enabled
should now report:
$ systemctl is-enabled systemd-oomd
masked
If you'd like to later unmask (or re-enable) a service, that can be done with, for example,
$ systemctl enable systemd-oomd
$ systemctl unmask systemd-oomd
See man systemctl
for more details; in particular, note the caveats regarding masking of systemd
services.
No comments:
Post a Comment