[systemd-devel] shell / systemd config files

Andrey Borzenkov arvidjaar at gmail.com
Tue May 21 03:26:19 PDT 2013


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
----><----


More information about the systemd-devel mailing list