[systemd-devel] nspawn and mariadb /run/mysql

Damian Ivanov damianatorrpm at gmail.com
Wed Jun 17 07:49:12 UTC 2020


Hello Lennart,

Thanks for the answer.
I will report this in the SUSE issue tracker than.

A workaround I found for me is to create the structure like this:
CONTAINER/root/
CONTAINER/run/mysql
CONTAINER/run/passenger
CONTAINER/run/obs

and use -bind="" option for the problematic run dirs,
where mariadb is only of them.

Damian


On Tue, Jun 16, 2020 at 10:33 AM Lennart Poettering
<lennart at poettering.net> wrote:
>
> On Di, 21.04.20 10:40, Damian Ivanov (damianatorrpm at gmail.com) wrote:
>
> > Hi,
> >
> > After bootstrapping os and mariadb into $DIR
> > I booted the machine with:
> > systemd-nspawn -D  $DIR -b --resolv-conf=bind-host --capability=all
> > I had to remove  $DIR/etc/resolv.conf first as bind-host seems to fail
> > if $DIR/etc/resolv.conf already exists.
> >
> > mariadb.service was failing, after looking into mysql.log
> > I found that /run/mysql/mysql.sock (No such file or directory)
> >
> > /run is a temporary dir inside nspawn and not the actual $DIR/run
> > So I went ahead and created /run/mysql (which of course is gone when
> > the container is stopped)
> > For mariadb to work it is also required to chown -R mysql:mysql /run/mysql
> > which results in chown complaing no such group mysql
> >
> > The group is in /etc/groups and another attempt to add groupadd mysql
> > would faill saying that the group exists. Using chmod -R 777 /run/mysql worked.
> >
> > Is there some permanent solution to have mariadb work,
> > without recreating /run/mysql at container boot and even better with
> > groups working?
>
> This sounds like an OS packaging bug of mariadb. Usually they should
> ship tmpfiles.d snippets so that all necessary files in /run/ are
> created. Similar, they either should create all users or provide a
> sysusers.d snippet to have it created automatically on first boot.
>
> Ether way, this smells as if you should report it to your OS vendor.
>
> Lennart
>
> --
> Lennart Poettering, Berlin


More information about the systemd-devel mailing list