diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index a767b2e80a..dbb0dc7bd7 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -1246,21 +1246,6 @@
This is either the unescaped instance name (if applicable) with / prepended (if applicable), or the unescaped prefix name prepended with /.
- %c
- Control group path of the unit
- This path does not include the /sys/fs/cgroup/systemd/ prefix.
-
-
- %r
- Control group path of the slice the unit is placed in
- This usually maps to the parent control group path of %c.
-
-
- %R
- Root control group path below which slices and units are placed
- For system instances, this resolves to /, except in containers, where this maps to the container's root control group path.
-
-
%t
Runtime directory
This is either /run (for the system manager) or the path $XDG_RUNTIME_DIR resolves to (for user managers).
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c
index 4c95127c80..8f7eb84c61 100644
--- a/src/core/unit-printf.c
+++ b/src/core/unit-printf.c
@@ -78,12 +78,18 @@ static int specifier_filename(char specifier, void *data, void *userdata, char *
return unit_name_to_path(u->id, ret);
}
+static void bad_specifier(Unit *u, char specifier) {
+ log_unit_warning(u, "Specifier '%%%c' used in unit configuration, which is deprecated. Please update your unit file, as it does not work as intended.", specifier);
+}
+
static int specifier_cgroup(char specifier, void *data, void *userdata, char **ret) {
Unit *u = userdata;
char *n;
assert(u);
+ bad_specifier(u, specifier);
+
if (u->cgroup_path)
n = strdup(u->cgroup_path);
else
@@ -101,6 +107,8 @@ static int specifier_cgroup_root(char specifier, void *data, void *userdata, cha
assert(u);
+ bad_specifier(u, specifier);
+
n = strdup(u->manager->cgroup_root);
if (!n)
return -ENOMEM;
@@ -115,6 +123,8 @@ static int specifier_cgroup_slice(char specifier, void *data, void *userdata, ch
assert(u);
+ bad_specifier(u, specifier);
+
if (UNIT_ISSET(u->slice)) {
Unit *slice;
@@ -238,9 +248,9 @@ int unit_full_printf(Unit *u, const char *format, char **ret) {
* (which are likely not suitable for unescaped inclusion in unit names):
*
* %f: the unescaped instance if set, otherwise the id unescaped as path
- * %c: cgroup path of unit
- * %r: where units in this slice are placed in the cgroup tree
- * %R: the root of this systemd's instance tree
+ * %c: cgroup path of unit (deprecated)
+ * %r: where units in this slice are placed in the cgroup tree (deprecated)
+ * %R: the root of this systemd's instance tree (deprecated)
* %t: the runtime directory to place sockets in (e.g. "/run" or $XDG_RUNTIME_DIR)
*
* %h: the homedir of the running user