Sample Header Ad - 728x90

How to avoid zombie process while working with named pipe?

0 votes
2 answers
1219 views
We normally do the writing job to a FIFO file in background using a control operator &. Something like below. if [ ! -p "/tmp/mysqld.init" ]; then mkfifo /tmp/mysqld.init fi echo "something" > /tmp/mysqld.init & exec mysqld --init-file=/tmp/mysqld.init But when the fifo file is readout the echo process get a zombie process. How can it be avoided ? **Note** This script is a docker entrypoint script and I don't have a proper zombie handler. Mysqld always takes the pid 1. Something like below. PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND 1 0 mysql S 383m 19% 0 0% mysqld --init-file=/tmp/mysqld.init 40 0 root R 1532 0% 1 0% top 7 1 root Z 0 0% 0 0% [entrypoint.sh] Probably I can use tini an init system for docker but without it how can it be achieved ? Double fork ?
Asked by SkyRar (201 rep)
Jan 21, 2019, 09:34 PM
Last activity: Dec 7, 2020, 07:58 AM