[systemd-devel] How to modify files from within systemd *.service? (for example using /bin/echo and stdout redirection)

Joachim joachim.banzhaf at googlemail.com
Sat May 26 00:19:23 PDT 2012


Hi Peter,

Shawns way to setup the keyboard is probably the best, but to answer the 
redirects part:

Am Samstag, 26. Mai 2012 08:34:06 schrieb shawn:
> On Sat, 2012-05-26 at 02:27 -0400, Peter Lemenkov wrote:
> > * How to restore the original ">" and "<" behaviour if required?

It doesnt work because redirects are a shell feature and systemd starts 
programs without the help of a shell. So this line

ExecStart=/bin/echo 2 > /tmp/test.txt

would need to be transformed into

ExecStart=/bin/bash -c 'echo 2 > /tmp/test.txt'

untested, but should work.


More information about the systemd-devel mailing list