summaryrefslogtreecommitdiff
path: root/src/basic/cgroup-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-09-22 19:57:07 +0200
committerSven Eden <yamakuzure@gmx.net>2017-11-21 07:14:40 +0100
commit02a0ffa93bc95561f744bc42c8710fc6795bcbc1 (patch)
tree444df88d10c8a0dddf94c0c3859f4d9bda2c214e /src/basic/cgroup-util.c
parent58da9c4933dc569030ba1bc54386cf04838ac0dc (diff)
cgroup-util: downgrade log messages from library code to LOG_DEBUG
These errors don't really matter, that's why we log and proceed in the current code. However, we currently log at LOG_WARNING, but we really shouldn't given that this is library code. Hence downgrade this to LOG_DEBUG.
Diffstat (limited to 'src/basic/cgroup-util.c')
-rw-r--r--src/basic/cgroup-util.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index a991f29da..5fc59d2ef 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -103,12 +103,9 @@ int cg_read_pid(FILE *f, pid_t *_pid) {
return 1;
}
-int cg_read_event(
- const char *controller,
- const char *path,
- const char *event,
- char **val) {
-
+int cg_read_event(const char *controller, const char *path, const char *event,
+ char **val)
+{
_cleanup_free_ char *events = NULL, *content = NULL;
char *p, *line;
int r;
@@ -912,7 +909,7 @@ int cg_set_group_access(
if (r > 0 && streq(controller, SYSTEMD_CGROUP_CONTROLLER)) {
r = cg_set_group_access(SYSTEMD_CGROUP_CONTROLLER_LEGACY, path, mode, uid, gid);
if (r < 0)
- log_warning_errno(r, "Failed to set group access on compat systemd cgroup %s: %m", path);
+ log_debug_errno(r, "Failed to set group access on compatibility systemd cgroup %s, ignoring: %m", path);
}
return 0;
@@ -958,9 +955,11 @@ int cg_set_task_access(
if (r < 0)
return r;
if (r > 0 && streq(controller, SYSTEMD_CGROUP_CONTROLLER)) {
+ /* Always propagate access mode from unified to legacy controller */
+
r = cg_set_task_access(SYSTEMD_CGROUP_CONTROLLER_LEGACY, path, mode, uid, gid);
if (r < 0)
- log_warning_errno(r, "Failed to set task access on compat systemd cgroup %s: %m", path);
+ log_debug_errno(r, "Failed to set task access on compatibility systemd cgroup %s, ignoring: %m", path);
}
return 0;
@@ -1007,7 +1006,7 @@ int cg_get_xattr(const char *controller, const char *path, const char *name, voi
int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
_cleanup_fclose_ FILE *f = NULL;
char line[LINE_MAX];
- const char *fs, *controller_str = NULL;
+ const char *fs, *controller_str;
size_t cs = 0;
int unified;