core: support <soft:hard> ranges for RLIMIT options
authorKarel Zak <kzak@redhat.com>
Fri, 20 Nov 2015 11:54:10 +0000 (12:54 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 25 Nov 2015 11:03:32 +0000 (12:03 +0100)
commit91518d20ddf0376808544576d0ef0883cedc67d4
treed5e687e43d3f1494f1d94e26e27efdc71013bb60
parent6098bb0dc31b1c472ab868088d04234352c44b75
core: support <soft:hard> ranges for RLIMIT options

The new parser supports:

 <value>       - specify both limits to the same value
 <soft:hard>   - specify both limits

the size or time specific suffixes are supported, for example

  LimitRTTIME=1sec
  LimitAS=4G:16G

The patch introduces parse_rlimit_range() and rlim type (size, sec,
usec, etc.) specific parsers. No code is duplicated now.

The patch also sync docs for DefaultLimitXXX= and LimitXXX=.

References: https://github.com/systemd/systemd/issues/1769
man/systemd-system.conf.xml
man/systemd.exec.xml
src/core/load-fragment.c
src/test/test-unit-file.c