[systemd-devel] [systemd-nspawn] nginx: [emerg] open() "/dev/stderr" failed (6: No such device or address)
Peter Paule
systemd-devel at fedux.org
Sun Apr 26 05:18:35 PDT 2015
> 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).
I modified the unit file to use dd instead of nginx. I can reproduce the issue.
By mistake I forgot to add the "systemd-nspawn" call.
[Unit]
Description=Webservice for %I
[Service]
ExecStart=/usr/bin/dd if=/dev/zero of=/dev/stderr bs=1M count=5
KillMode=process
KillSignal=SIGINT
SendSIGKILL=no
After that I started the service and checked its status:
% root at localhost ~/tmp/centos-nginx/files/machines (git)-[master] # systemctl status nginx at example_com
● nginx at example_com.service - Webservice for example_com
Loaded: loaded (/etc/systemd/system/nginx at .service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2015-04-26 14:09:10 CEST; 1s ago
Process: 5124 ExecStart=/usr/bin/dd if=/dev/zero of=/dev/stderr bs=1M count=5 (code=exited, status=1/FAILURE)
Main PID: 5124 (code=exited, status=1/FAILURE)
Apr 26 14:09:10 localhost systemd[1]: Started Webservice for example_com.
Apr 26 14:09:10 localhost systemd[1]: Starting Webservice for example_com...
Apr 26 14:09:10 localhost dd[5124]: /usr/bin/dd: failed to open ‘/dev/stderr’: No such device or address
Apr 26 14:09:10 localhost systemd[1]: nginx at example_com.service: main process exited, code=exited, status=1/FAILURE
Apr 26 14:09:10 localhost systemd[1]: Unit nginx at example_com.service entered failed state.
Apr 26 14:09:10 localhost systemd[1]: nginx at example_com.service failed.
Thus the error seems to be not a problem of systemd-nspawn.
More information about the systemd-devel
mailing list