mirror of
https://github.com/troglobit/finit.git
synced 2026-09-30 21:13:01 +07:00
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:
+2
-1
@@ -29,6 +29,7 @@
|
||||
#include "helpers.h"
|
||||
#include "plugin.h"
|
||||
#include "service.h"
|
||||
#include "conf.h"
|
||||
|
||||
#define DAEMON "dbus-daemon"
|
||||
#define ARGS "--nofork --system"
|
||||
@@ -58,7 +59,7 @@ static void setup(void *arg)
|
||||
|
||||
/* Register service with Finit */
|
||||
snprintf(line, sizeof(line), "[S12345] %s %s -- %s", cmd, ARGS, DESC);
|
||||
if (service_register(SVC_TYPE_SERVICE, line, NULL))
|
||||
if (service_register(SVC_TYPE_SERVICE, line, global_rlimit, NULL))
|
||||
_pe("Failed registering %s", DAEMON);
|
||||
free(cmd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user