[systemd-devel] [systemd-nspawn] nginx: [emerg] open() "/dev/stderr" failed (6: No such device or address)

Lennart Poettering lennart at poettering.net
Fri Apr 24 06:24:13 PDT 2015


On Fri, 24.04.15 12:06, Peter Paule (systemd-devel at fedux.org) wrote:

> Hi,
> 
> I run nginx in a CentOS 7.0 container via systemd-nspawn. nginx logs to
> stderr/stdout via configuration to capture logs via journald.
> 
> nginx.conf
> 
>   error_log  /dev/stderr warn;
> 
> 
> If I use systemd 219-1 (-1 is the package number of Arch Linux) which seems
> to be a non-patched systemd 219, everything is fine. If I upgrade to systemd
> 219-6, nginx cannot be started via systemd-nspawn. systemd 219-6 includes
> this patch "https://projects.archlinux.org/svntogit/packages.git/tree/repos/core-x86_64/0001-nspawn-when-connected-to-pipes-for-stdin-stdout-pass.patch?h=packages/systemd".
> BTW: I see the same error if I use systemd-git-HEAD.
> 
> I see the following errors in journal - I tried bot "stderr" and "stdout".
> 
>   Apr 24 04:48:12 server systemd-nspawn[421]: nginx: [emerg] open()
> "/dev/stdout" failed (6: No such device or address)
>   Apr 24 04:48:45 server systemd-nspawn[496]: nginx: [emerg] open()
> "/dev/stderr" failed (6: No such device or address)

Any idea what the precise syscall is that triggers that? i.e. what
strace says?

> If I run the container with
> 
>   sudo /usr/bin/systemd-nspawn --register=no -M docker-centos-nginx

What happens if you use "nsenter" instead to join all namespaces of
the running nginx container and invoke a shell there, and then try to
acess /dev/stderr? Does this also work?

What happens if you use "dd" to write to /dev/stdout? Does that work,
too? (i think that bash handles /dev/stderr specially when you use it
with redirection, that's why I am asking).

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list