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