Univention Bugzilla – Bug 39148
Dovecot does not close its fds
Last modified: 2015-09-24 14:37:39 CEST
Currently, I'm unable to install dovecot in the Univention Apps because the installation stalls. Philipp found out that the file descriptors aren't closed. After stopping dovecot, the installation the installation completed: root@unassigned-hostname:~# lsof | grep 44799 tee 15256 root 0r FIFO 0,8 0t0 44799 pipe dovecot 17607 root 2w FIFO 0,8 0t0 44799 pipe log 17614 root 2w FIFO 0,8 0t0 44799 pipe root@unassigned-hostname:~# ps -ef | grep univention-install root 15181 12134 0 07:26 ? 00:00:00 /bin/sh /usr/lib/univention-install/99_setup_oxseforucs.inst root 15226 15181 0 07:26 ? 00:00:00 /bin/bash /usr/sbin/univention-install -y --force-yes -o=APT::Get::AllowUnauthenticated=1; univention-ox-meta-singleserver univention-ox-text univention-ox-guard root 24068 5951 0 08:07 pts/0 00:00:00 grep univention-install root@unassigned-hostname:~# strace -p 15226 Process 15226 attached - interrupt to quit wait4(-1, ^C <unfinished ...> Process 15226 detached root@unassigned-hostname:~# /etc/init.d/dovecot stop [ ok ] Stopping IMAP/POP3 mail server: dovecot. root@unassigned-hostname:~# strace -p 15226 attach: ptrace(PTRACE_ATTACH, ...): No such process root@unassigned-hostname:~# ps -ef | grep univention-install root 15181 12134 0 07:26 ? 00:00:00 /bin/sh /usr/lib/univention-install/99_setup_oxseforucs.inst root 25413 5951 0 08:08 pts/0 00:00:00 grep univention-install root@unassigned-hostname:~#
Should this command also fail? DEBIAN_FRONTEND=noninteractive apt-get install univention-mail-dovecot | tee -a logfile The dovecot daemon is also restarted during the installation.
(In reply to Stefan Gohmann from comment #1) > Should this command also fail? > > DEBIAN_FRONTEND=noninteractive apt-get install univention-mail-dovecot | tee > -a logfile > > The dovecot daemon is also restarted during the installation. OK, it is stderr. To reproduce use: root@master401:~# /etc/init.d/dovecot restart 2>&1 | tee -a logfile Restarting IMAP/POP3 mail server: dovecot. Redirect to a file works: root@master401:~# /etc/init.d/dovecot restart 2>/tmp/a root@master401:~#
r62950 | Bug #39148 test: 01/11 daemonize FDs tests/01_base/11restart_services > * Testing /etc/init.d/dovecot restart ... > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME > dovecot 12747 root 2w REG 253,0 0 391212 /tmp/tmp.GQjI7zdF8b/2 > log 12750 root 2w REG 253,0 0 391212 /tmp/tmp.GQjI7zdF8b/2 Also does not close other inherited FDs; see `grep -A10 ^close_fds /etc/init.d/apache2`
(In reply to Philipp Hahn from comment #3) > r62950 | Bug #39148 test: 01/11 daemonize FDs > tests/01_base/11restart_services > > > * Testing /etc/init.d/dovecot restart ... > > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME > > dovecot 12747 root 2w REG 253,0 0 391212 /tmp/tmp.GQjI7zdF8b/2 > > log 12750 root 2w REG 253,0 0 391212 /tmp/tmp.GQjI7zdF8b/2 > > Also does not close other inherited FDs; > see `grep -A10 ^close_fds /etc/init.d/apache2` The test case failed, please check. I'm not sure we should restart every service at the beginning of our Jenkins tests (01/11). Can you move it to the end of the tests?
There is a bug filed in upstream: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734897 Dovecot 2.0 did receive an official patch to close stderr: http://hg.dovecot.org/dovecot-2.0/rev/08e4280e5bfd But it seems in Dovecot 2.2 only stdin and stdout are closed: http://hg.dovecot.org/dovecot-2.2/file/7378ab8e3b4d/src/master/main.c#l845 The init script now simply redirects stderr to /dev/null. All error messages are sent to /var/log/dovecot.* anyway. Commit: 63410 YAML (r63411): 2015-09-02-univention-mail-dovecot.yaml
OK: r63410 OK: r63411 OK: /etc/init.d/dovecot restart OK: lsof `tty` OK: DEBIAN_FRONTEND=noninteractive aptitude -y install '?source-package(^univention-mail-dovecot$)~i' OK: lsof -a -p `pgrep dovecot` -d 1-3 FIXED: errata-announce -V 2015-09-02-univention-mail-dovecot.yaml r63547 | YAML Bug #39302 OK 2015-09-02-univention-mail-dovecot.yaml
<http://errata.software-univention.de/ucs/4.0/333.html>