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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -