<literal>%i</literal> specifier in many of the
configuration options. Other specifiers that may be
used are <literal>%n</literal>, <literal>%N</literal>,
- <literal>%p</literal>, <literal>%P</literal> and
- <literal>%I</literal>, for the full unit name, the
- unescaped unit name, the prefix name, the unescaped
- prefix name and the unescaped instance name,
- respectively. The prefix name here refers to the
- string before the @, i.e. "getty" in the example
- above, where "tty3" is the instance name.</para>
+ <literal>%p</literal>, <literal>%P</literal>,
+ <literal>%I</literal> and <literal>%f</literal>, for
+ the full unit name, the unescaped unit name, the
+ prefix name, the unescaped prefix name, the unescaped
+ instance name and the unescaped filename,
+ respectively. The unescaped filename is either the
+ unescaped instance name (if set) with / prepended (if
+ necessary), or the prefix name similarly prepended
+ with /. The prefix name here refers to the string
+ before the @, i.e. "getty" in the example above, where
+ "tty3" is the instance name.</para>
<para>If a unit file is empty (i.e. has the file size
0) or is symlinked to <filename>/dev/null</filename>
char *unit_name_escape(const char *f);
char *unit_name_unescape(const char *f);
+char *unit_name_path_unescape(const char *f);
+
bool unit_name_is_template(const char *n);
char *unit_name_replace_instance(const char *f, const char *i);
return strdup("");
}
+static char *specifier_filename(char specifier, void *data, void *userdata) {
+ Unit *u = userdata;
+ assert(u);
+
+ if (u->meta.instance)
+ return unit_name_path_unescape(u->meta.instance);
+
+ return unit_name_to_path(u->meta.instance);
+}
+
char *unit_name_printf(Unit *u, const char* format) {
/*
{ 'P', specifier_prefix_unescaped, NULL },
{ 'i', specifier_string, u->meta.instance },
{ 'I', specifier_instance_unescaped, NULL },
+ { 'f', specifier_filename, NULL },
{ 0, NULL, NULL }
};
# (at your option) any later version.
[Unit]
-Description=File System Check on %I
+Description=File System Check on %f
DefaultDependencies=no
Requires=%i.device
After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
[Service]
Type=oneshot
RemainAfterExit=no
-ExecStart=@rootlibexecdir@/systemd-fsck %I
+ExecStart=@rootlibexecdir@/systemd-fsck %f