[lxc-users] LXC container and Systemd
Goran
sendmailtogoran at gmail.com
Thu Aug 9 13:11:02 UTC 2018
I did as you told. What I can say is that the user/group directive are
the problem.
With this config it works:
[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
User and group are available:
# id grafana
uid=207(grafana) gid=207(grafana) groups=207(grafana)
2018-08-09 10:30 GMT+02:00 Fajar A. Nugraha <list at fajar.net>:
> 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
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
More information about the lxc-users
mailing list