Bug 49316 - WantedBy= in [Install] is unescaped unexpectedly
Summary: WantedBy= in [Install] is unescaped unexpectedly
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium minor
Assignee: Lennart Poettering
QA Contact:
: 78994 (view as bug list)
Depends on:
Reported: 2012-04-30 16:05 UTC by rodrigo
Modified: 2014-05-26 18:15 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

Don't remove escaping (465 bytes, patch)
2012-07-23 13:11 UTC, Michal Sekletar
Details | Splinter Review

Description rodrigo 2012-04-30 16:05:25 UTC
I've been trying to configure a service to start / stop whenever a given device appears / disappears, and I came out with the following options:


Then I do a "systemctl enable test.service" and that works perfectly.

But here is the problem: if the device contains escaped characters:


It just half-works: the service is stopped when the device disappears, but it is not started when it later reappears.

After some research, I found that the problem is that the command "systemctl enable test.service" creates the link as:


If then I rename it into:


And it works again.

It looks like the escape rules in the unit file are different for different  lines.

Rodrigo Rivas Costa
Comment 1 Michal Sekletar 2012-07-23 13:09:03 UTC
I think we should not remove escaping from strings in [Install] section, I will attach patch which should resolve the issue, but I'm not 100% sure that it's not gonna break something else.
Comment 2 Michal Sekletar 2012-07-23 13:11:32 UTC
Created attachment 64541 [details] [review]
Don't remove escaping
Comment 3 Lennart Poettering 2012-10-17 17:22:53 UTC
This should be fixed in 194 (possibly older). If not, please reopen.
Comment 4 yannay 2014-05-25 21:58:04 UTC
*** Bug 78994 has been marked as a duplicate of this bug. ***
Comment 5 yannay 2014-05-25 21:59:42 UTC
Still here in V212 (I mistakenly opened a new bug for it).
Comment 6 Zbigniew Jedrzejewski-Szmek 2014-05-26 18:15:38 UTC
I refreshed the patch and pushed it as http://cgit.freedesktop.org/systemd/systemd/commit/?id=000f6e56.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.