]> git.proxmox.com Git - systemd.git/blame - units/systemd-oomd.service.in
Fix boot-and-services autopkgtest
[systemd.git] / units / systemd-oomd.service.in
CommitLineData
a032b68d
MB
1# SPDX-License-Identifier: LGPL-2.1-or-later
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]
11Description=Userspace Out-Of-Memory (OOM) Killer
12Documentation=man:systemd-oomd.service(8)
13DefaultDependencies=no
14Before=multi-user.target shutdown.target
15Conflicts=shutdown.target
3a6ce677 16ConditionControlGroupController=v2
ce5f39bd 17ConditionControlGroupController=memory
3a6ce677
BR
18ConditionPathExists=/proc/pressure/cpu
19ConditionPathExists=/proc/pressure/io
20ConditionPathExists=/proc/pressure/memory
ea0999c9
MB
21Requires=systemd-oomd.socket
22After=systemd-oomd.socket
a032b68d
MB
23
24[Service]
25AmbientCapabilities=CAP_KILL CAP_DAC_OVERRIDE
26BusName=org.freedesktop.oom1
27CapabilityBoundingSet=CAP_KILL CAP_DAC_OVERRIDE
8b3d4ff0 28ExecStart={{ROOTLIBEXECDIR}}/systemd-oomd
a032b68d
MB
29IPAddressDeny=any
30LockPersonality=yes
31MemoryDenyWriteExecute=yes
32# Reserve some minimum amount of memory so that systemd-oomd can continue to
33# run in resource starved scenarios.
34MemoryMin=64M
35MemoryLow=64M
36NoNewPrivileges=yes
37OOMScoreAdjust=-900
38PrivateDevices=yes
39PrivateTmp=yes
40ProtectClock=yes
41ProtectHome=yes
42ProtectHostname=yes
43ProtectKernelLogs=yes
44ProtectKernelModules=yes
45ProtectKernelTunables=yes
46ProtectSystem=strict
47Restart=on-failure
48RestrictAddressFamilies=AF_UNIX
49RestrictNamespaces=yes
50RestrictRealtime=yes
51RestrictSUIDSGID=yes
52SystemCallArchitectures=native
53SystemCallErrorNumber=EPERM
54SystemCallFilter=@system-service
55Type=notify
56User=systemd-oom
8b3d4ff0 57{{SERVICE_WATCHDOG}}
a032b68d
MB
58
59[Install]
60WantedBy=multi-user.target
61Alias=dbus-org.freedesktop.oom1.service