Bug 86171 - ExecStart with whitespace in path
Summary: ExecStart with whitespace in path
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-11 20:11 UTC by Dennis
Modified: 2015-01-06 00:42 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Dennis 2014-11-11 20:11:17 UTC
I have a service file with a path on ExecStart option that contains whitespaces. 
The manpage suggests to double or single quote the command. 

I have tried every possible combination, but the only thing that works is when you use \x20 for each whitespace.

On errors i get either "main process exited, code=exited, status=203/EXEC" or "Executable path is not absolute, ignoring: ..."

What does not work:

ExecStart=/PATH WITH SPACES/daemon -Param1 -Param2
ExecStart="/PATH WITH SPACES/daemon" -Param1 -Param2
ExecStart="/PATH WITH SPACES/daemon -Param1 -Param2"
ExecStart="/PATH WITH SPACES/daemon" "-Param1 -Param2"
ExecStart="/PATH WITH SPACES/daemon" "-Param1" "-Param2"
ExecStart=/PATH\ WITH\ SPACES/daemon -Param1 -Param2

What does work:

ExecStart=/PATH\x20WITH\x20SPACES/daemon -Param1 -Param2
Comment 1 Zbigniew Jedrzejewski-Szmek 2014-12-19 00:39:58 UTC
I clarified the rules in http://cgit.freedesktop.org/systemd/systemd/commit/?id=c853953658.

ExecStart=/PATH WITH SPACES/daemon -Param1 -Param2        -> 5 args
ExecStart="/PATH WITH SPACES/daemon" -Param1 -Param2      -> 3 args
ExecStart="/PATH WITH SPACES/daemon -Param1 -Param2"      -> 1 arg
ExecStart="/PATH WITH SPACES/daemon" "-Param1 -Param2"    -> 2 args
ExecStart="/PATH WITH SPACES/daemon" "-Param1" "-Param2"  -> 3 args
ExecStart=/PATH\ WITH\ SPACES/daemon -Param1 -Param2      -> error
ExecStart=/PATH\x20WITH\x20SPACES/daemon -Param1 -Param2  -> 3 args

I think that any version which returns 3 args should do the right thing for you.


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.