chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
34f0fd8
)
cgroup: explain when we cannot initialize the cgroup stuff
author
Lennart Poettering
<lennart@poettering.net>
Tue, 29 Mar 2011 18:29:02 +0000
(20:29 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 29 Mar 2011 18:29:02 +0000
(20:29 +0200)
src/cgroup.c
patch
|
blob
|
history
diff --git
a/src/cgroup.c
b/src/cgroup.c
index b75fe0bee0c9116f9736b8153db15de1fd1fef67..5864858dd7e7099011aebcc48ed1b128e18ab1f2 100644
(file)
--- a/
src/cgroup.c
+++ b/
src/cgroup.c
@@
-226,8
+226,10
@@
int manager_setup_cgroup(Manager *m) {
assert(m);
/* 1. Determine hierarchy */
assert(m);
/* 1. Determine hierarchy */
- if ((r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 0, ¤t)) < 0)
+ if ((r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 0, ¤t)) < 0) {
+ log_error("Cannot determine cgroup we are running in: %s", strerror(-r));
goto finish;
goto finish;
+ }
if (m->running_as == MANAGER_SYSTEM)
strcpy(suffix, "/system");
if (m->running_as == MANAGER_SYSTEM)
strcpy(suffix, "/system");
@@
-246,14
+248,17
@@
int manager_setup_cgroup(Manager *m) {
/* We need a new root cgroup */
m->cgroup_hierarchy = NULL;
if (asprintf(&m->cgroup_hierarchy, "%s%s", streq(current, "/") ? "" : current, suffix) < 0) {
/* We need a new root cgroup */
m->cgroup_hierarchy = NULL;
if (asprintf(&m->cgroup_hierarchy, "%s%s", streq(current, "/") ? "" : current, suffix) < 0) {
+ log_error("Out of memory");
r = -ENOMEM;
goto finish;
}
}
/* 2. Show data */
r = -ENOMEM;
goto finish;
}
}
/* 2. Show data */
- if ((r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_hierarchy, NULL, &path)) < 0)
+ if ((r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_hierarchy, NULL, &path)) < 0) {
+ log_error("Cannot find cgroup mount point: %s", strerror(-r));
goto finish;
goto finish;
+ }
log_debug("Using cgroup controller " SYSTEMD_CGROUP_CONTROLLER ". File system hierarchy is at %s.", path);
log_debug("Using cgroup controller " SYSTEMD_CGROUP_CONTROLLER ". File system hierarchy is at %s.", path);
@@
-276,6
+281,7
@@
int manager_setup_cgroup(Manager *m) {
close_nointr_nofail(m->pin_cgroupfs_fd);
if ((m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK)) < 0) {
close_nointr_nofail(m->pin_cgroupfs_fd);
if ((m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK)) < 0) {
+ log_error("Failed to open pin file: %m");
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}