#1129940 earlyoom: -N script cannot write (log)files due to systemd'isms

Package:
earlyoom
Source:
earlyoom
Description:
Early OOM Daemon
Submitter:
Peter Gervai
Date:
2026-03-06 14:17:01 UTC
Severity:
normal
#1129940#5
Date:
2026-03-06 09:57:21 UTC
From:
To:
When using under systemd the "-N" forked script is almost useless, since
it cannot write anything, including logfiles.
ProtectSystem=strict - can't write anything, even tmp; also can't access the script
DynamicUser=true - can't write anything, also due to random uid can't write created files again

(I've got my pain points from 1.7-1, I see that 1.9.0 contains even more systemd restrictions,
but I've got enough, easier to run under runit, you may check those options too.)

This isn't covered on readme (which is, by the way, very hard to read on a markdown-less
console), nor manpage. People may end up with
/tmp/test.sh: 3: cannot create /tmp/test.log: Read-only file system

#1129940#10
Date:
2026-03-06 14:14:59 UTC
From:
To:
I think the best way is to run `systemctl edit earlyoom`, which will
create an override file for you or let you edit an existing one.