/etc/init.d/opendkim fails to start opendkim when run over ssh with a pseudo-tty

Bug #761967 reported by Sam Umbach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dk-milter (Ubuntu)
Expired
Undecided
Unassigned
dpkg (Ubuntu)
Invalid
Undecided
Unassigned
opendkim (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: opendkim

Without a pty, opendkim start and restart properly launch the opendkim milter daemon:
$ ssh -T ubuntu@192.168.2.117 sudo /etc/init.d/opendkim restart
Restarting OpenDKIM: opendkim.

But if I force pty allocation (as I do in my Capistrano deployments), the opendkim daemon is NOT started:
$ ssh -tt ubuntu@192.168.2.117 sudo /etc/init.d/opendkim restart
Restarting OpenDKIM: opendkim.
Connection to 192.168.2.117 closed.

I will also report this issue to the opendkim team as I'm not sure if this is Ubuntu- or Debian-specific.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: opendkim 2.1.3+dfsg-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-22.33-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic i686
Architecture: i386
Date: Fri Apr 15 16:46:07 2011
LiveMediaBuild: Ubuntu-Netbook 10.10 "Maverick Meerkat" - Release i386 (20101007)
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: opendkim

Revision history for this message
Sam Umbach (sumbach) wrote :
Revision history for this message
Sam Umbach (sumbach) wrote :

This may be a more general problem. I am seeing the same behavior with `/etc/init.d/dk-filter restart`.

Revision history for this message
Sam Umbach (sumbach) wrote :

Looks like a similar issue was found (and fixed) in the tomcat package last year #588481

Revision history for this message
Sam Umbach (sumbach) wrote :

The tomcat6 fix was to call start-stop-daemon with the -b (--background) flag. This may not be a proper fix here, as this would require both opendkim and dk-filter packages to make the change (among other packages, I assume) and could result in silent failures when starting these daemons.

The most likely culprit I can find is 3706d6214a86593e72bc9514f08f3c4e0fd0a92c in git://git.debian.org/git/dpkg/dpkg.git, which changed the start-stop-daemon behavior around opening, closing, and detaching from the tty.

Revision history for this message
Sam Umbach (sumbach) wrote :

I've confirmed that this issue occurs when starting the opendkim daemon directly and is not an issue with start-stop-daemon or the /etc/init.d/opendkim script. I've also confirmed that the problem occurs whether I start the daemon as a non-root user via sudo or as user root without sudo. The following does NOT start the opendkim daemon approximately 10% of the time.

    ssh -tt root@maverick '/usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:8891@localhost'

I see essentially identical behavior for the dk-filter daemon. Additionally, the behavior is the same for 10.04 lucid, 10.10 maverick, and 11.04 beta 2 natty. I have NOT been able to replicate the problem on 9.10 karmic (but since it is a timing issue, I'm not sure if this really is a new issue introduced since karmic).

Adding "&& sleep 1" to the command keeps the pty open long enough for the daemon to be launched properly. With the one-second sleep in place, I have not be able to replicate the issue.

Revision history for this message
Sam Umbach (sumbach) wrote :

The problem occurs whether or not the daemon is launched with start-stop-daemon. This is NOT a start-stop-daemon or dpkg issue.

Changed in dpkg (Ubuntu):
status: New → Invalid
Revision history for this message
David Bürgin (glts) wrote :

I cannot reproduce this with opendkim 2.11.0~alpha-11 (Ubuntu 18.04).

Changed in opendkim (Ubuntu):
status: New → Incomplete
David Bürgin (glts)
Changed in dk-milter (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for dk-milter (Ubuntu) because there has been no activity for 60 days.]

Changed in dk-milter (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for opendkim (Ubuntu) because there has been no activity for 60 days.]

Changed in opendkim (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.