Fix #45: add support for rlimit per service/run/task/inetd/tty

This patch extends the existing rlimit implementation to support setting
limits per service, run/task, inetd, and tty.

Use rlimit in /etc/finit.conf to change the global setting, which is
then inherited to each /etc/finit.d/*.conf.  For each .conf file the
rlimit is reinitialized to the global finit.conf settings.

Also, add `unlimited` keyword, to replace the now deprecated `infinity`
keyword.  The latter is however kept, for compatibility with previous
releases, for the foreseeable future.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-11-26 16:35:37 +01:00
1 parent 44007c86f2
commit b68c5c1291
12 files changed
+154 -76

No files matched your search

+7 -4
View File
@@ -51,12 +51,15 @@ Syntax
* `network <PATH>`
Script or program to bring up networking, with optional arguments
* `rlimit <hard|soft> RESOURCE <LIMIT|infinity>`
* `rlimit <hard|soft> RESOURCE <LIMIT|unlimited>`
Set the hard or soft limit for a resource. `RESOURCE` is a lower-case
string matching the `RLIMIT_` constants from `setrlimit(2)`, without
the prefix. E.g. to set `RLIMIT_CPU`, use `cpu`. The limit is an
integer that depends on the resource being modified, see the man page
for more information. The special limit `infinity` means unlimited.
the prefix. E.g. to set `RLIMIT_CPU`, use `cpu`.
The limit is an integer that depends on the resource being modified,
see the man page, or the kernel `/proc/PID/limits` file, for more
information. Finit versions before v3.1 used `infinity` for
`unlimited`, which is still a supported keyword.
```shell
# No process is allowed more than 8MB of address space