[lxc-users] LXC container and Systemd

Fajar A. Nugraha list at fajar.net
Fri Aug 10 01:04:11 UTC 2018


On Thu, Aug 9, 2018 at 8:11 PM, Goran <sendmailtogoran at gmail.com> wrote:

> I did as you told. What I can say is that the user/group directive are
> the problem.
>
> With this config it works:
>
>

Now we're getting somehwere :D



> [Unit]
> Description=Grafana service
> After=network.target
>
> [Service]
> # User=grafana
> # Group=grafana
> # WorkingDirectory=/usr/share/grafana
> # ExecStart=/usr/bin/grafana-server -config=/etc/grafana.ini
> ExecStart=/usr/bin/runuser -s /bin/bash -g grafana -l grafana -c
> 'grafana-server -config=/etc/grafana.ini -homepath /usr/share/grafana'
> LimitNOFILE=10000
> TimeoutStopSec=20
> SuccessExitStatus=0 2
>
> [Install]
> WantedBy=multi-user.target
>
> What I don't understand is why the user/group directive are not
> accepted and quitted with error
>
> Aug 09 13:06:10 monitor systemd[25843]: grafana.service: Failed to
> determine user credentials: No such process
> Aug 09 13:06:10 monitor systemd[25843]: grafana.service: Failed at
> step USER spawning /usr/bin/runuser: No such process
>
>

This looks promising: "/usr/bin/runuser: No such process"

Try something like this:

[Service]
User=grafana
Group=grafana
ExecStart=/bin/bash -c 'grafana-server -config=/etc/grafana.ini -homepath
/usr/share/grafana'

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20180810/2164117e/attachment.html>


More information about the lxc-users mailing list