Skip to contentSkip to conversation

systemd: services should never be targets for the OOM killer

PATCH New Cristian Rodríguez 1 participant 1 message Mar 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: services should never be targets for the OOM killer

Otherwise systems with limited memory will fail to boot.

---
 modules.d/98systemd/dracut-cmdline-ask.service | 2 +-
 modules.d/98systemd/dracut-cmdline.service     | 2 +-
 modules.d/98systemd/dracut-emergency.service   | 2 +-
 modules.d/98systemd/dracut-initqueue.service   | 1 +
 modules.d/98systemd/dracut-mount.service       | 2 +-
 modules.d/98systemd/dracut-pre-mount.service   | 2 +-
 modules.d/98systemd/dracut-pre-pivot.service   | 2 +-
 modules.d/98systemd/dracut-pre-trigger.service | 2 +-
 modules.d/98systemd/dracut-pre-udev.service    | 2 +-
 modules.d/98systemd/dracut-shutdown.service    | 1 +
 modules.d/98systemd/emergency.service          | 2 +-
 11 files changed, 11 insertions(+), 9 deletions(-)
modules.d/98systemd/dracut-cmdline-ask.service +1 -1
index 9a34b35..81447b3 100644
@@ -27,7 +27,7 @@ StandardError=inherit
 RemainAfterExit=yes
 KillMode=process
 IgnoreSIGPIPE=no
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
modules.d/98systemd/dracut-cmdline.service +1 -1
index 6eeb991..de03a65 100644
@@ -31,7 +31,7 @@ StandardOutput=syslog
 StandardError=syslog+console
 KillMode=process
 RemainAfterExit=yes
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
modules.d/98systemd/dracut-emergency.service +1 -1
index 5a6d525..ba7f2c9 100644
@@ -28,7 +28,7 @@ StandardOutput=inherit
 StandardError=inherit
 KillMode=process
 IgnoreSIGPIPE=no
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
modules.d/98systemd/dracut-initqueue.service +1 -0
index 5d772f7..722fd23 100644
@@ -34,6 +34,7 @@ StandardOutput=syslog
 StandardError=syslog+console
 KillMode=process
 RemainAfterExit=yes
+OOMScoreAdjust=-1000
 
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
modules.d/98systemd/dracut-mount.service +1 -1
index 1b14f4a..5d0295f 100644
@@ -26,7 +26,7 @@ StandardOutput=syslog
 StandardError=syslog+console
 KillMode=process
 RemainAfterExit=yes
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
modules.d/98systemd/dracut-pre-mount.service +1 -1
index 96ea995..78a8ed4 100644
@@ -28,7 +28,7 @@ StandardOutput=syslog
 StandardError=syslog+console
 KillMode=process
 RemainAfterExit=yes
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
modules.d/98systemd/dracut-pre-pivot.service +1 -1
index f5a85ce..45a2eff 100644
@@ -34,7 +34,7 @@ StandardOutput=syslog
 StandardError=syslog+console
 KillMode=process
 RemainAfterExit=yes
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
modules.d/98systemd/dracut-pre-trigger.service +1 -1
index 826b89b..b6649d3 100644
@@ -28,7 +28,7 @@ StandardOutput=syslog
 StandardError=syslog+console
 KillMode=process
 RemainAfterExit=yes
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
modules.d/98systemd/dracut-pre-udev.service +1 -1
index 73740be..cd87b10 100644
@@ -31,7 +31,7 @@ StandardOutput=syslog
 StandardError=syslog+console
 KillMode=process
 RemainAfterExit=yes
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
modules.d/98systemd/dracut-shutdown.service +1 -0
index 21c9d29..aff764b 100644
@@ -19,3 +19,4 @@ RemainAfterExit=yes
 Type=oneshot
 ExecStart=/bin/true
 ExecStop=/usr/lib/dracut/dracut-initramfs-restore
+OOMScoreAdjust=-1000
modules.d/98systemd/emergency.service +1 -1
index 5f1eaa2..5b13417 100644
@@ -27,7 +27,7 @@ StandardOutput=inherit
 StandardError=inherit
 KillMode=process
 IgnoreSIGPIPE=no
-
+OOMScoreAdjust=-1000
 # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
 # terminates cleanly.
 KillSignal=SIGHUP
Signature · 1 line
2.3.1