linux - How to write systemd environment variables value which contains = -
in systemd units file, have environment content key=iamvalue=abc
, can see value iamvalue=abc
contains =
.
for situation, how can write unit files?
i have tried following, seems invalid:
[unit] description=... [service] workingdirectory=... execstart=... restart=always restartsec=10 syslogidentifier=... user=root environment=key="iamvalue=abc"
i tested works in test.service
file:
[unit] description=hi [service] type=oneshot environment=key="iamvalue=abc" execstart=/bin/bash -c "/bin/echo key:$key"
if run , journalctl -u test
, can see key containing equal sign works.
i've proposed update official systemd docs better clarify case.
Comments
Post a Comment