[systemd-devel] shell / systemd config files

Colin Guthrie gmane at colin.guthr.ie
Tue May 21 03:29:44 PDT 2013


'Twas brillig, and Andrey Borzenkov at 21/05/13 11:26 did gyre and gimble:
> On Tue, May 21, 2013 at 1:11 PM, Colin Guthrie <gmane at colin.guthr.ie> wrote:
>> 'Twas brillig, and James Buren at 20/05/13 18:28 did gyre and gimble:
>>> Files such as /etc/machine-info have an incompatibility with systemd in regards to how
>>> it writes and/or parses them. Take the following sample:
>>>
>>> PRETTY_HOSTNAME="\'\"\$\`\\"
>>>
>>> Systemd will translate this to: '"$`\
>>> However, the shells bash and dash will translate this to: \'"$`\
>>>
>>> So, it appears to be that systemd is escaping single quotes when the shells themselves
>>> do not honor it for single quotes here. Thoughts for a solution? I ask because I have to
>>> write some systemd config files for a distro installer, and cannot use hostnamectl yet.
>>
>> AFAIUI, it's not meant to be 100% shell compatible anyway,
> 
> According to man machine-info, it is.
> 
> ----><----
> The basic file format of machine-info is a newline-separated list of
> environment-like shell-compatible variable assignments. It is possible
> to source the configuration from shell scripts
> ----><----

Mea culpa!

I guess this information slightly conflicts with the various other
places where environment-like stuff is done (e.g. when processing the
EnvironmentFile= stuff where there are certain things that are not quite
the same as shell (e.g. continuation support IIRC the discussion about
that not toooo long ago).

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/



More information about the systemd-devel mailing list