This demo shows 3 extra things:
-
You can start a templated unit, and the environment variable allow simple strings, i.e.:
systemctl start envvar@mynamewould populateDATE_myname -
You must escape
%characters inside commands or systemd would substitute with own values. -
You can clean the environment variables automatically with
ExecStop=directive.