Description
When using openrc-run's input_file directive with a fifo pipe at the path specified, doing rc-service <name> start hangs, and only continues the start process after something is written to the pipe.
After using strace, I found that the issue is in an openat call within start-stop-daemon.
Possibly consider using O_NONBLOCK or O_NDELAY for the openat call?
Example
Service:
#!/sbin/openrc-run
name=example
command=sleep
command_args=infinity
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
input_file="/var/lib/example-stdin.pipe"
Commands:
mkdir -p /var/lib
mkfifo /var/lib/example-stdin.pipe
rc-service example start
# resolve the hanging
echo bweh > /var/lib/example-stdin.pipe
Description
When using openrc-run's
input_filedirective with a fifo pipe at the path specified, doingrc-service <name> starthangs, and only continues the start process after something is written to the pipe.After using
strace, I found that the issue is in anopenatcall within start-stop-daemon.Possibly consider using
O_NONBLOCKorO_NDELAYfor theopenatcall?Example
Service:
Commands: