On Mon, 11.07.11 16:49, Barry Scott (barry.sc...@onelan.co.uk) wrote: > I would like to take advantage of ${var} in the ExecStart lines. > > However I find that there is a issue with handling of while space. > > If I code this > > ExecStart=/myservice --arg ${optional_arg} > > If option_arg is not defined argv is ['/myservice', '--arg', ''] > Is it a bug that you do not strip trailing whitespace after substituion? > > > If I code this > > ExecStart=/myservice --arg${optional_arg} > > and define > > option_arg= --debug > > argv is ['/myservice', '--arg--debug'] > Is it a bug that the whitespace after = was stripped?
systemd supports exactly two ways to resolve env vars. a) You place ${FOO} as part of a word, or as word of its own on the command line, in which case it will pre replaced by the value of the env var -- and the value will *not* be split up at whitespace. Note the use of {}! b) You place $FOO as separate word on the command line, which means that the this will be replaced by the value of the env var split up at whitespace. Note that no {} is used for this syntax! In either way the parser for EnvironmentFile= will strip leading and trailing whitespace from the values of assignments, unless you use "" quotes. This is documented on systemd.service(5), under ExecStart=. Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel