[systemd-devel] %i/%I instance expansion in ExecStartPre ?

Lennart Poettering lennart at poettering.net
Fri May 3 06:08:02 PDT 2013


On Thu, 02.05.13 10:41, Colin Guthrie (gmane at colin.guthr.ie) wrote:

> The rules for ExecStartPre and ExecStart are the same so you can use the
> %i/%I specifiers in the arguments - that's what they were designed for :)
> 
> Looking at "man systemd.service" and checking the ExecStart section it
> says: "The command line accepts % specifiers as described in
> systemd.unit(5)."
> 
> Looking at that it says:
> "To refer to the instance string from within the configuration file you
> may use the special %i specifier in many of the configuration options.
> Other specifiers exist, the full list is:"
> 
> So granted, this isn't clear.
> 
> There are other comments that state the binary name must be a full
> absolute path, but some cross reference here wouldn't be a bad idea.
> 
> Note I'm also just checking my patched up 195, not current head so this
> may have been addressed already.

Current versions are pretty explicit about this:

        "The command line accepts '%' specifiers as described in
        systemd.unit(5). Note that the first argument of the command
        line (i.e. the program to execute) may not include
        specifiers."

See http://0pointer.de/public/systemd-man/systemd.service.html

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list