|
| 1 | +# SPDX-License-Identifier: LGPL-2.1+ |
| 2 | +# |
| 3 | +# This file is part of systemd. |
| 4 | +# |
| 5 | +# systemd is free software; you can redistribute it and/or modify it |
| 6 | +# under the terms of the GNU Lesser General Public License as published by |
| 7 | +# the Free Software Foundation; either version 2.1 of the License, or |
| 8 | +# (at your option) any later version. |
| 9 | + |
| 10 | +[Unit] |
| 11 | +Description=Userspace Out-Of-Memory (OOM) Killer |
| 12 | +Documentation=man:systemd-oomd.service(8) |
| 13 | +ConditionCapability=CAP_KILL |
| 14 | +DefaultDependencies=no |
| 15 | +Before=multi-user.target shutdown.target |
| 16 | +Conflicts=shutdown.target |
| 17 | + |
| 18 | +[Service] |
| 19 | +AmbientCapabilities=CAP_KILL CAP_DAC_OVERRIDE |
| 20 | +BusName=org.freedesktop.oom1 |
| 21 | +CapabilityBoundingSet=CAP_KILL CAP_DAC_OVERRIDE |
| 22 | +ExecStart=@rootlibexecdir@/systemd-oomd |
| 23 | +IPAddressDeny=any |
| 24 | +LockPersonality=yes |
| 25 | +MemoryDenyWriteExecute=yes |
| 26 | +# Reserve some minimum amount of memory so that systemd-oomd can continue to |
| 27 | +# run in resource starved scenarios. |
| 28 | +MemoryMin=64M |
| 29 | +MemoryLow=64M |
| 30 | +NoNewPrivileges=yes |
| 31 | +OOMScoreAdjust=-900 |
| 32 | +PrivateDevices=yes |
| 33 | +PrivateTmp=yes |
| 34 | +ProtectClock=yes |
| 35 | +ProtectHome=yes |
| 36 | +ProtectHostname=yes |
| 37 | +ProtectKernelLogs=yes |
| 38 | +ProtectKernelModules=yes |
| 39 | +ProtectKernelTunables=yes |
| 40 | +ProtectSystem=strict |
| 41 | +Restart=on-failure |
| 42 | +RestrictAddressFamilies=AF_UNIX |
| 43 | +RestrictNamespaces=yes |
| 44 | +RestrictRealtime=yes |
| 45 | +RestrictSUIDSGID=yes |
| 46 | +SystemCallArchitectures=native |
| 47 | +SystemCallErrorNumber=EPERM |
| 48 | +SystemCallFilter=@system-service |
| 49 | +Type=notify |
| 50 | +User=systemd-oom |
| 51 | +@SERVICE_WATCHDOG@ |
| 52 | + |
| 53 | +[Install] |
| 54 | +WantedBy=multi-user.target |
| 55 | +Alias=dbus-org.freedesktop.oom1.service |
0 commit comments