Skip to content

Add --ignore-user option to skip processes by username or UID - #375

Open
bhzhu203 wants to merge 2 commits into
rfjakob:masterfrom
bhzhu203:master
Open

Add --ignore-user option to skip processes by username or UID #375
bhzhu203 wants to merge 2 commits into
rfjakob:masterfrom
bhzhu203:master

Conversation

@bhzhu203

Copy link
Copy Markdown

No description provided.

bhzhu203 added 2 commits July 9, 2026 16:55
Allow users to specify one or more users (by name or numeric UID)
whose processes should never be killed by earlyoom. The option can
be repeated to ignore multiple users.
getpwnam depends on glibc NSS modules which are loaded dynamically
and do not work reliably in statically linked binaries. Read
/etc/passwd directly to resolve usernames to UIDs instead.
@rfjakob

rfjakob commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Hi, I'm missing the rationale here. When would you want this?

@bhzhu203

Copy link
Copy Markdown
Author

earlyoom frequently terminates one of my crucial programs, which consumes a relatively high amount of memory.
I have tried this method before to avoid the program being killed, but it didn't work
/usr/bin/earlyoom --avoid codingless &
/usr/bin/earlyoom --avoid codingless -m 8 &
This important program of mine only runs on specific users, so ignoring/protecting the processes of specific users is what I need.

Additionally, this submission includes a static compilation fix to ensure compatibility with compilation under Alpine Linux

@rfjakob

rfjakob commented Jul 14, 2026

Copy link
Copy Markdown
Owner

What should earlyoom kill instead when memory is low?

@bhzhu203

Copy link
Copy Markdown
Author

What should earlyoom kill instead when memory is low?

Other non-essential processes are allowed to be killed, such as those not on the whitelist (use the --ignore-user option to skip processes by username or UID). This allows a series of whitelisted processes to be added to the ignore list of earlyoom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants