Skip to content

PrivateDevices=true fails inside a container if /dev/ptmx is bind mounted #6121

@major

Description

@major

Submission type

  • Bug report

systemd version the issue has been seen with

systemd 219 (systemd-219-30.el7_3.9.x86_64)

Used distribution

CentOS 7

In case of bug report: Expected behaviour you didn't see

Expect MariaDB service to start with PrivateDevices=true

In case of bug report: Unexpected behaviour you saw

MariaDB fails to start

Journal output:

systemd[9435]: Failed at step NAMESPACE spawning /bin/sh: Invalid argument
Subject: Process /bin/sh could not be executed
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
The process /bin/sh could not be executed and failed.

In case of bug report: Steps to reproduce the problem

Install LXC 2.0.8 on CentOS 7
Create a CentOS 7 container
Install MariaDB 10.2.x
Start MariaDB

It appears that /dev/ptmx is a bind mount of /dev/pts/ptmx within the LXC container. It also appears that systemd is attempting to bind mount /dev/ptmx into a namespace since PrivateDevices=true is set in the MariaDB service file. Here is some strace output that led me to believe that the bind mounted /dev/ptmx may be the problem.

I've opened a bug with upstream LXC about this as well since it seemed to break in the 2.0.8 release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions