diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-04-22 23:10:13 -0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-22 23:14:12 -0300 |
commit | ae018d9bc900d6355dea4af05119b49c67945184 (patch) | |
tree | 07a311ae16ac331f1044503bbb01a4e111331fb2 /src/shared/cgroup-util.h | |
parent | cd8f53ab1601513cc3407447bfe3359ee7139676 (diff) |
cgroup: make sure all our cgroup objects have a suffix and are properly escaped
Session objects will now get the .session suffix, user objects the .user
suffix, nspawn containers the .nspawn suffix.
This also changes the user cgroups to be named after the numeric UID
rather than the username, since this allows us the parse these paths
standalone without requiring access to the cgroup file system.
This also changes the mapping of instanced units to cgroups. Instead of
mapping foo@bar.service to the cgroup path /user/foo@.service/bar we
will now map it to /user/foo@.service/foo@bar.service, in order to
ensure that all our objects are properly suffixed in the tree.
Diffstat (limited to 'src/shared/cgroup-util.h')
-rw-r--r-- | src/shared/cgroup-util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/shared/cgroup-util.h b/src/shared/cgroup-util.h index 5457d1bcaa..2099f934b4 100644 --- a/src/shared/cgroup-util.h +++ b/src/shared/cgroup-util.h @@ -75,6 +75,7 @@ int cg_get_user_path(char **path); int cg_get_machine_path(char **path); int cg_path_get_session(const char *path, char **session); +int cg_path_get_owner_uid(const char *path, uid_t *uid); int cg_path_get_unit(const char *path, char **unit); int cg_path_get_user_unit(const char *path, char **unit); int cg_path_get_machine_name(const char *path, char **machine); @@ -82,6 +83,7 @@ int cg_path_get_machine_name(const char *path, char **machine); int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup); int cg_pid_get_session(pid_t pid, char **session); +int cg_pid_get_owner_uid(pid_t pid, uid_t *uid); int cg_pid_get_unit(pid_t pid, char **unit); int cg_pid_get_user_unit(pid_t pid, char **unit); int cg_pid_get_machine_name(pid_t pid, char **machine); @@ -91,3 +93,6 @@ int cg_path_decode_unit(const char *cgroup, char **unit); char **cg_shorten_controllers(char **controllers); int cg_controller_from_attr(const char *attr, char **controller); + +char *cg_escape(const char *p); +char *cg_unescape(const char *p); |