How to protect Services
Use case
unbound.service
systemctl edit unbound.service
[Unit]
Before=remote-fs-pre.target
[Service]
OOMScoreAdjust=-1000
ExecStartPre=
ExecStartPre=/usr/sbin/unbound-checkconf
systemctl daemon-reload
systemctl restart unbound.service
How to protect Process
Use case
icewm/tl-session
- */1 * * * * root pgrep -f "icewm" | while read PID; do echo -17 > /proc/$PID/oom_adj; done
- */1 * * * * root pgrep -f "tl-session" | while read PID; do echo -17 > /proc/$PID/oom_adj; done