Skip to content

Fix mhonarc stdin PIPE.

Problem:

Aug 15 17:56:24 2015 (21609) This is MHonArc v2.6.19+, Perl 5.020002
linux
Reading database ...
Adding message to /srv/data/mhonarc/my@list.tld

No new messages

Apparently no data was coming in over stdin.

The cause was the missing stdin=PIPE in the Popen() call, resulting in FD 0 from the process startup to be passed as stdin; as can be seen in this listing from /proc/$$/fd:

lrwx------ 1 list list 64 Aug 15 17:56 0 -> /dev/pts/4 (deleted)
l-wx------ 1 list list 64 Aug 15 17:56 1 -> /tmp/output.fds
lr-x------ 1 list list 64 Aug 15 17:56 10 -> /usr/local/bin/mhonarc
l-wx------ 1 list list 64 Aug 15 17:56 11 -> pipe:[50142214]
l-wx------ 1 list list 64 Aug 15 17:56 2 -> pipe:[50142215]

The fix is to set stdin=PIPE as done here. The close_fds=True argument needs not be set as well, since it's default on POSIX since Python 3.

Merge request reports