]> code.ossystems Code Review - openembedded-core.git/commit
systemd: fix systemctl enable script for template units
authorEnrico Jorns <ejo@pengutronix.de>
Tue, 12 Jan 2016 12:55:43 +0000 (13:55 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 29 Jan 2016 18:14:55 +0000 (18:14 +0000)
commit8b9b9fd700b19731b14a7dcc51d0fa013a5e106a
tree5b971d4d0c51c6c70f62a82b12dbbdfa192525ca
parent50f84bbf3cf340e0e98abb7994dd4eade4183078
systemd: fix systemctl enable script for template units

The systemctl script supports enabling template units by evaluating
"DefaultInstance" parameter. Unfortunately, due to the sed replacement
mechanism, all escaping used in the DefaultInstance string, e.g. for
giving path names with dashes, is expanded too early.

Thus for

  DefaultInstance=-path\x2dwith\x2ddashes

a path unit `foobar@.path` will be installed with a symlink named

  foobar@-path-with-dashed.path

that is interpreted as the path `/path/with/dashes` instead of the
intended path nam `/path-with-dashes`.

To fix this behavior additional escaping of the backslashes in the
`DefaultInstance` string is required so that sed does not expand the
escaped characters.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/systemd/systemd-systemctl/systemctl