A group may define one or more parameters through an additional argument of the def-group node with the total number of parameters:
def-group GroupA 2 { sd { section Service { set PIDFile "/run/${0}-pid" set ExecStartPre "/usr/bin/pre-${1}" } } }
Parameters can be accessed in string values or dependency arguments through ${0}, ${1}, ..., ${N-1} specifiers, which are replaced with their respective values when the unit is instantiated. In the previous example, loading GroupA with arguments "P1" and P2 will set the value of PIDFile field to /run/P1-pid and ExecStartPre field to /usr/bin/pre-P2. You cannot apply these specifiers to field names.
Additionally, the special specifier ${$} expands into a literal $.
Arguments are provided to dependency groups as positional arguments:
def-group GroupB { pull { GroupA "pidname" "exec-sh" } } def-group GroupC 1 { pull { GroupA "${0}-A" "${0}-B" } }
You can additionally use special non-positional parameters that will expand to some well-known paths or other useful strings. Up to now, the following keys are recognized:
${DIR|HOME} ¶home directory of current user;
${DIR|DATA} ¶XDG user data directory, equivalent to systemd specifier ‘%D’;
${DIR|CONFIG} ¶XDG user configuration directory, equivalent to systemd specifier ‘%E’;
${DIR|RUNTIME} ¶XDG user runtime directory, equivalent to systemd specifier ‘%t’;
${DIR|CACHE} ¶XDG user cache directory, equivalent to systemd specifier ‘%C’;
${SD|INSTANCE} ¶instance of the current systemd unit, equivalent to systemd specifier ‘%i’.