summarylogtreecommitdiffstats
path: root/oomd.service
blob: 5eaeeec480fe3ee90ec84fc8973e976e89fb78f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
[Unit]
Description=userspace out-of-memory killer
AssertDirectoryNotEmpty=/proc/pressure

[Service]
Type=simple
Restart=always
SyslogIdentifier=oomd
MemoryLow=64M

Environment=OOMD_CONFIG=/etc/oomd.json
Environment=OOMD_INTERVAL=5
EnvironmentFile=-/etc/default/oomd

ExecStartPre=/usr/bin/oomd --check-config ${OOMD_CONFIG}
ExecStart=/usr/bin/oomd --config ${OOMD_CONFIG} --interval ${OOMD_INTERVAL}

CapabilityBoundingSet=
NoNewPrivileges=yes
DevicePolicy=closed
DeviceAllow=/dev/kmsg
ProtectHome=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_UNIX
RestrictRealtime=yes
RestrictNamespaces=yes
MemoryDenyWriteExecute=yes
LockPersonality=true
SystemCallArchitectures=native
SystemCallFilter=@system-service

# See https://aur.archlinux.org/packages/oomd/#comment-711090
# PrivateTmp=yes
# ProtectSystem=strict

[Install]
WantedBy=multi-user.target