Package: opendmarc
Version: 1.3.2-6+deb10u1
Tags: patch
Severity: important

Dear maintainer,

I have found the following problem with the opendmarc package.
Firstly, note that I do not use systemd
and this may be the reason why the bug had not been noticed yet,
as I suspect it would not occur
(or not be noticeable)
with systemd.

The issue that occurred to me is as follows.
During installation,
(more precisely, during package configuration)
the daemon is started
but, immediately after, dpkg hangs
as if waiting for the configure script to exit.
I can also see that the daemon is indeed running as normal
but the "postinst" script is a zombie.
I was then able to make the installation complete *successfully*
by killing the opendmarc daemon.


Upon further investigation,
I concluded that the cause is the following.
Looking into the postinst script,
I see that it sources "confmodule".
That being the case,
file descriptor 3 gets attached to what was stdin.
Apparently, all file descriptors must be closed
by the daemon (or by whoever execs it)
else debconf hangs
(see http://www.fifi.org/doc/debconf-doc/tutorial.html#AEN198).
As it turns out, looking at the source of opendmarc,
I see that opendmarc only closes file descriptors 0, 1 and 2
but not 3.

Note that I am not a Debian developer
and my analysis might be incorrect.
I am, however, providing my guess as to how this should be fixed
but I would suggest that someone else check this carefully.

P.S.: Judging by similar bug reports,
this seems to be a common issue with debconf
(c.f. #227482 #782753)
so maybe you will know a better solution.

Yours faithfully,
B.R.S. Roso.

Attachment: opendmarc.postinst.diff
Description: Binary data

Reply via email to