[systemd-devel] RFC : PATCH: initial implementation of system wide rlimit

Frederic Crozat fcrozat at suse.com
Mon Mar 26 05:25:10 PDT 2012


Hi all,

following one of our bug opened on systemd ( https://bugzilla.novell.com/show_bug.cgi?id=744818 ) and after discussing the issue on irc,
I found some time to do a initial implementation of systemd wide rlimit support.

Idea is simple :
- admin can set system wide limits for all services in /etc/systemd/system.conf, with a syntax similar to the one from systemd.exec(5) (LimitCPU ... LimitRTTIME).
- those limits, when set, override the default one (set by kernel) to all services started, except those which might have their own limits specified in their .unit file

Current limitations / Not done yet:
- currently, the limits are set on both rlim_cur and rlim_max (due to reuse of config_parse_limit code). I'd like to extend the implementation to support separate values for rlim_max and rlim_cur.
But I'm not 100% sure how we should express that in configuration file. Should we use a additional keyword (LimitCPU / LimitSoftCPU ) or a dual value (LimitCPU=100;10) ?
- for openSUSE, we will ship a generator which will transform /etc/sysconfig/ulimit into a /run/systemd/system.conf.

Comments and code review welcome.

-- 
Frederic Crozat <fcrozat at suse.com>
SUSE



More information about the systemd-devel mailing list