Bug 41711

Summary: Truncated leading characters in environment variable
Product: systemd Reporter: Eduardo Tongson <propolice>
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Eduardo Tongson 2011-10-12 01:26:50 UTC
on Systemd 37

Snippet of a service:
...
EnvironmentFile=/etc/env
ExecStart=-/bin/busybox ntpd ${ntpdopts}
...

contents of /etc/env:
ntpdopts="-p pool"

When the service is run the '-p' is truncated:
busybox[216]: ntpd: bad address ' pool'

Runs normally if I add a leading space :
/etc/env
ntpdopts=" -p pool"

/bin/busybox ntpd  -p pool
Note: the space is passed too
Comment 1 Lennart Poettering 2011-10-12 07:33:03 UTC
Please read the systemd.service(5), specifically the part about ExecStart=.

Basically, use $ntpdopts, not ${ntpdopts} if you want your variable value split up into individual arguments.

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.