3 ms·
Define "automatically" and "services" first ;-) Normally you just set it in the systemd's unit file for each daemon you want to adjust. So for some definitions
by viraptor 10y ago
Define "automatically" and "services" first ;-) Normally you just set it in the systemd's unit file for each daemon you want to adjust. So for some definitions of the above the answer is yes. (OOMScoreAdjust in https://www.freedesktop.org/software/systemd/man/systemd.exec.html https://www.freedesktop.org/software/systemd/man/systemd.exe...)
- JdeBP 10y agoPersonally, I use one tool for both FreeBSD and Linux. Picking up the (imported) rc.conf variable for a service is a mere matter of oom-kill-protect fromenv And the conversion from something like OOMScoreAdjust is quite straightforward. A PostgreSQL systemd unit file that read OOMScoreAdjust=-625 becomes a run program that contains oom-kill-protect -- -625 * http://marc.info/?l=freebsd-hackers&m=145425153624976&w=2 http://marc.info/?l=freebsd-hackers&m=145425153624976&w=2 * http://jdebp.eu./Softwares/nosh/guide/oom-kill-protect.html http://jdebp.eu./Softwares/nosh/guide/oom-kill-protect.html
- feld 10y agoCool, thanks for sharing. I would hate to have to muck around in /proc manually to set this.