[lxc-users] LXC container and Systemd
Fajar A. Nugraha
list at fajar.net
Thu Aug 9 08:30:23 UTC 2018
On Tue, Aug 7, 2018 at 11:13 PM, Goran <sendmailtogoran at gmail.com> wrote:
> I'm starting Grafana on top of Arch Linux without problem. But when I
> install Grafana into an Arch Linux LXC container on top of Arch Linux
> OS I can't start it.
>
> The error is:
>
> systemd[24509]: grafana.service: Failed to determine user credentials:
> No such process
> systemd[24509]: grafana.service: Failed at step USER spawning
> /usr/bin/grafana-server: No such process
>
> It looks like a systemd error but it's working on top of a real OS.
>
> Here is my grafana.service file: https://pastebin.com/T8XU98XT
>
> I can start Grafana without any problems with
>
> runuser -s /bin/bash -g grafana -l grafana -c 'grafana-server
> -config=/etc/grafana.ini -homepath /usr/share/grafana'
>
>
To confirm: you can start it by logging into the container and run the
above command?
> It looks like LXC is hindering systemd to start the process.
>
>
I think the easiest way to troubleshoot is just use that command in a
systemd unit. Something like
[Unit]
Description=Simple run test
[Service]
ExecStart=/bin/bash -c "runuser -s /bin/bash -g grafana -l grafana -c
'grafana-server -config=/etc/grafana.ini -homepath /usr/share/grafana'"
[Install]
WantedBy=multi-user.target
Put it as a some service file somewhere on /etc/systemd/system, start it,
and see what happens. If that works, you can start changing up the service
to look more like the original while finding out which lines from the
original service file is problematic.
--
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20180809/ba82a5f7/attachment.html>
More information about the lxc-users
mailing list