top | item 13388704

(no title)

naftulikay | 9 years ago

> Now agreed, if your workflow demands that you embed a Bash while loop in a unit, you’re already in a bad place, but there are times where this is required for templating purposes.

It's right there in the post. I have indeed had to do something like this in the wild to run a Docker container with special needs.

discuss

order

colemickens|9 years ago

I don't see how "templating purposes" answers the question. I deploy services on VMs that need to parameterized and I can parameterize via templating a written-to-disk shell script that is then just simply executed in the unit... or I can have more dynamic parameterization and use environment variables and Environment= lines in the unit. The latter solution means the substitution is effectively happening in the same place as if they were inlined parameters, so I can't imagine a scenario when it wouldn't be workable.

admsyn|9 years ago

Both you and OP haven't mentioned why you needed to do it inline as opposed to in an external script, though.