summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-20 00:09:35 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-20 00:10:32 +0200
commitcba6e0627d659a33df31aaa74d0d701c4bc9f317 (patch)
treee973cc904a6f703a4a1836d130e16d4cc780bf28 /src/core/service.c
parentc74f17d96cccd4cc998fd037cb92046930188c91 (diff)
units: apply default resource limits to socket/mount/swap processes too
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 78f9a59c7f..30598de9b8 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -130,7 +130,6 @@ static const UnitActiveState state_translation_table_idle[_SERVICE_STATE_MAX] =
static void service_init(Unit *u) {
Service *s = SERVICE(u);
- int i;
assert(u);
assert(u->load_state == UNIT_STUB);
@@ -150,9 +149,6 @@ 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);
kill_context_init(&s->kill_context);
RATELIMIT_INIT(s->start_limit, 10*USEC_PER_SEC, 5);
@@ -1284,7 +1280,7 @@ static int service_load(Unit *u) {
if ((r = service_add_default_dependencies(s)) < 0)
return r;
- r = unit_patch_working_directory(UNIT(s), &s->exec_context);
+ r = unit_exec_context_defaults(u, &s->exec_context);
if (r < 0)
return r;
}