rfjakob / earlyoom

earlyoom - Early OOM Daemon for Linux
MIT License
2.96k stars 157 forks source link

Let systemd set `Nice` and `OOMScoreAdjust` #289

Closed bmwiedemann closed 1 year ago

bmwiedemann commented 1 year ago

Allow one more capability to avoid warnings on startup (with -p):

Could not set priority: Permission denied. Continuing anyway
Could not set oom_score_adj: Permission denied. Continuing anyway

I found this issue while using the openSUSE earlyoom package that defaults to -p.

rfjakob commented 1 year ago

Wouldn't the "right" solution be to set the nice level and oom score via systemd?

bmwiedemann commented 1 year ago

Ok. Adapted it.

rfjakob commented 1 year ago

Hi, i think you forgot about the oom score?

On Mon, 20 Mar 2023, 08:02 Bernhard M. Wiedemann, @.***> wrote:

Ok. Adapted it.

— Reply to this email directly, view it on GitHub https://github.com/rfjakob/earlyoom/pull/289#issuecomment-1475718805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACGA72DXIPUANB3WKFQOGDW476INANCNFSM6AAAAAAVKSZYFI . You are receiving this because you commented.Message ID: @.***>

bmwiedemann commented 1 year ago

Indeed. Looks even nicer now.

rfjakob commented 1 year ago

Slightly edited and merged as https://github.com/rfjakob/earlyoom/commit/6ab1807ba5726c895bdb0a894112b829de01bc75 .

The change I made is OOMScoreAdjust=-100 to match what -p does.

You had -1000, which means a memory leak in earlyoom (I don't know of any) could bring the whole system down.