mirror of
https://github.com/troglobit/finit.git
synced 2026-11-01 13:10:32 +00:00
Fix regression introduced in 7ef25ab, global rlimits not initialized
Services that are instantiated by plugins, and thus don't have a .conf file, tried to use uninitialized rlimits. This caused the kernel to immediately kill those services for violating their own rlimits. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
80e4f025d3
commit
6b7255fdeb
1 file changed
+8
@@ -902,6 +902,14 @@ int conf_init(uev_ctx_t *ctx)
|
|||||||
/* default hostname */
|
/* default hostname */
|
||||||
hostname = strdup(DEFHOST);
|
hostname = strdup(DEFHOST);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get current global limits, which may be overridden from both
|
||||||
|
* finit.conf, for Finit and its services like getty+watchdogd,
|
||||||
|
* and *.conf in finit.d/, for each service(s) listed there.
|
||||||
|
*/
|
||||||
|
for (int i = 0; i < RLIMIT_NLIMITS; i++)
|
||||||
|
getrlimit(i, &global_rlimit[i]);
|
||||||
|
|
||||||
/* prepare /etc watcher */
|
/* prepare /etc watcher */
|
||||||
fd = iwatch_init(&iw_conf);
|
fd = iwatch_init(&iw_conf);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
|
|||||||
Reference in new issue
Block a user