<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 10, 2018 at 4:38 PM, Goran <span dir="ltr"><<a href="mailto:sendmailtogoran@gmail.com" target="_blank">sendmailtogoran@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Always the same behavior, if the binary is executed as a user<br>
different from root, systemd does not find the binary.<br>
<br>
In this case<br>
<br>
# which bash<br>
/usr/bin/bash<br>
<br>
can't be found by systemd. ExecStart=whatsoever does not work. It<br>
doesn't matter if it's bash or grafana-server as long the user differs<br>
from root.<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br></div></div></blockquote><div><br></div><div><br></div><div>This test unit works fine for me in lxd. Container created using "lxc launch images:archlinux arch-test"</div><div><br></div><div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">######</div></div><div># cat /etc/systemd/system/test-asuser.service </div><div>[Unit]</div><div>Description=run as user test</div><div><br></div><div>[Service]</div><div>User=nobody</div><div>Group=nobody</div><div><br></div><div>Type=oneshot</div><div>ExecStart=/bin/bash -c 'echo $(date) id is $(id) >> /tmp/test-asuser.log'</div><div>######<br></div><div><br></div><div>How did you create your container? If you use lxc (not lxd), try the 'download' template.<br></div><div><br></div><div>-- </div><div>Fajar</div></div></div></div>