From c93ff2e913a6da516c83c0d3f8df73004acc6c8b Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Wed, 21 Mar 2012 18:03:40 +0100 Subject: main: allow system wide limits for services --- src/core/service.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/service.c') diff --git a/src/core/service.c b/src/core/service.c index 28049a33c7..2bd29ff7e6 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -110,6 +110,7 @@ static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = { static void service_init(Unit *u) { Service *s = SERVICE(u); + int i; assert(u); assert(u->load_state == UNIT_STUB); @@ -129,6 +130,9 @@ static void service_init(Unit *u) { s->guess_main_pid = true; exec_context_init(&s->exec_context); + for (i = 0; i < RLIMIT_NLIMITS; i++) + if (UNIT(s)->manager->rlimit[i]) + s->exec_context.rlimit[i] = newdup(struct rlimit, UNIT(s)->manager->rlimit[i], 1); RATELIMIT_INIT(s->start_limit, 10*USEC_PER_SEC, 5); -- cgit v1.2.3-54-g00ecf