Merge lp:~xnox/upstart/fix-user-cgroup into lp:upstart/async

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 1663
Proposed branch: lp:~xnox/upstart/fix-user-cgroup
Merge into: lp:upstart/async
Diff against target: 56 lines (+22/-17)
1 file modified
init/cgroup.c (+22/-17)
To merge this branch: bzr merge lp:~xnox/upstart/fix-user-cgroup
Reviewer Review Type Date Requested Status
James Hunt Approve
Review via email: mp+222068@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Hunt (jamesodhunt) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'init/cgroup.c'
--- init/cgroup.c 2014-06-02 22:19:01 +0000
+++ init/cgroup.c 2014-06-04 16:15:49 +0000
@@ -54,6 +54,8 @@
5454
55#include <cgmanager/cgmanager-client.h>55#include <cgmanager/cgmanager-client.h>
5656
57extern int user_mode;
58
57/**59/**
58 * disable_cgroups:60 * disable_cgroups:
59 *61 *
@@ -1061,23 +1063,26 @@
1061 nih_assert (path);1063 nih_assert (path);
1062 nih_assert (cgroup_manager);1064 nih_assert (cgroup_manager);
10631065
1064 pid = getpid ();1066 if (!user_mode) {
10651067 pid = getpid ();
1066 /* Escape our existing cgroup for this controller by moving to1068
1067 * the root cgroup to avoid creating groups below the current1069 /* Escape our existing cgroup for this controller by moving to
1068 * cgroup.1070 * the root cgroup to avoid creating groups below the current
1069 */1071 * cgroup.
1070 ret = cgmanager_move_pid_abs_sync (NULL,1072 */
1071 cgroup_manager,1073 ret = cgmanager_move_pid_abs_sync (NULL,
1072 controller,1074 cgroup_manager,
1073 UPSTART_CGROUP_ROOT,1075 controller,
1074 pid);1076 UPSTART_CGROUP_ROOT,
10751077 pid);
1076 if (ret < 0)1078
1077 return FALSE;1079
10781080 if (ret < 0)
1079 nih_debug ("Moved pid %d to root of '%s' controller cgroup",1081 return FALSE;
1080 pid, controller);1082
1083 nih_debug ("Moved pid %d to root of '%s' controller cgroup",
1084 pid, controller);
1085 }
10811086
10821087
1083 /* Ask cgmanager to create the cgroup */1088 /* Ask cgmanager to create the cgroup */

Subscribers

People subscribed via source and target branches