On Tue, Apr 03, 2018 at 07:46:42PM -0400, Wietse Venema wrote: > I updated both the postfix-script file and the master daemon. > > I'd appreciate it if someone could verify that this will run the > master daemon with PID 1, and that 'postfix stop' in the container > will stop the master daemon. If it doesn't, then Linux does weird > stuff with PID 1 processes.
Unless I am missing something, postfix stop does not stop the master daemon inside a container: $ docker run -d -v /dev/log:/dev/log eraya/postfix:3.4_pre20180403-r1 Unable to find image 'eraya/postfix:3.4_pre20180403-r1' locally 3.4_pre20180403-r1: Pulling from eraya/postfix 973ffedf3041: Already exists 4d8110e24f25: Already exists bba655fd008e: Already exists 9250e489a277: Already exists a925f9420666: Already exists Digest: sha256:534a3645fbb1fedcfb51391cfb5cde7efa0b19057077a67900679b8a47ec875f Status: Downloaded newer image for eraya/postfix:3.4_pre20180403-r1 a49e9ce8d75de2eb9900bea47188b6ce7bf773cb7b0e10f7f7f5792340d51231 $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a49e9ce8d75d eraya/postfix:3.4_pre20180403-r1 "/usr/sbin/postfix s…" 7 seconds ago Up 6 seconds 25/tcp nostalgic_lumiere $ docker exec a49e9ce8d75d ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 71540 2876 ? Ss 14:52 0:00 /usr/libexec/postfix/master -i postfix 76 0.0 0.1 71524 2832 ? S 14:52 0:00 pickup -l -t unix -u postfix 77 0.0 0.1 71572 2864 ? S 14:52 0:00 qmgr -l -t unix -u root 78 0.0 0.0 17556 1184 ? Rs 14:52 0:00 ps aux $ docker exec a49e9ce8d75d postconf mail_version mail_version = 3.4-20180403 $ docker exec a49e9ce8d75d postfix stop $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a49e9ce8d75d eraya/postfix:3.4_pre20180403-r1 "/usr/sbin/postfix s…" About a minute ago Up 59 seconds 25/tcp nostalgic_lumiere i.e. master daemon still running after postfix stop. versus starting with an init: $ docker run -d -v /dev/log:/dev/log eraya/postfix:3.4_pre20180403 172645c305b89f9149d3cd14559da04c42bd3b369eaeb08253ec55b7032a61ed $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 172645c305b8 eraya/postfix:3.4_pre20180403 "/usr/local/bin/dumb…" 8 seconds ago Up 7 seconds 25/tcp naughty_edison $ docker exec 172645c305b8 ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 188 4 ? Ss 14:48 0:00 /usr/local/bin/dumb-init postfix start-fg root 5 0.0 0.0 18352 1696 ? Ss 14:48 0:00 /bin/sh /usr/libexec/postfix/postfix-script start-fg root 77 0.0 0.1 71540 2880 ? Ss 14:48 0:00 /usr/libexec/postfix/master postfix 78 0.0 0.1 71524 2836 ? S 14:48 0:00 pickup -l -t unix -u postfix 79 0.0 0.1 71572 2864 ? S 14:48 0:00 qmgr -l -t unix -u root 80 0.0 0.0 17556 1184 ? Rs 14:48 0:00 ps aux $ docker exec 172645c305b8 postconf mail_version mail_version = 3.4-20180403 $ docker exec 172645c305b8 postfix stop $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES i.e. no running container after postfix stop. -- Eray