Bug#702988: exim4: Possible incorrect handling of exim's pid file in /etc/init.d/exim4 script

Christian.Andretzky at MB.TU-Chemnitz.DE Christian.Andretzky at MB.TU-Chemnitz.DE
Wed Mar 13 18:43:52 UTC 2013


Package: exim4
Version: 4.80-7
Severity: normal

First of all - I don't know, if the following has something to do with the problem described in bug
#693696.

As far as I know, a pid file should be removed after stopping/killing the related process.
Here it seems that the related pid file (defined in /etc/init/d/exim4) is not removed after the related
process has stopped.

Example:
Step 1: Machine is running, exim4 is running
ballon:~# pidof exim4
28040
ballon:~# ls -la /var/run/exim4/exim.pid 
-rw-r--r-- 1 root Debian-exim 6 Mär 13 17:35 /var/run/exim4/exim.pid
ballon:~# cat /var/run/exim4/exim.pid 
28040

Step 2: now we stop exim4
ballon:~# invoke-rc.d exim4 stop
[ ok ] Stopping MTA: exim4_listener.
ballon:~# pidof exim4
ballon:~# 
(returns nothing)
ballon:~# ls -la /var/run/exim4/exim.pid 
-rw-r--r-- 1 root Debian-exim 6 Mär 13 17:35 /var/run/exim4/exim.pid
ballon:~# cat /var/run/exim4/exim.pid 
28040

Step 3: now we start exim4 again
ballon:~# pidof exim4
ballon:~# 
(returns nothing)
ballon:~# invoke-rc.d exim4 start
[ ok ] Starting MTA: exim4.
ballon:~# pidof exim4
28446
ballon:~# ls -la /var/run/exim4/exim.pid 
-rw-r--r-- 1 root Debian-exim 6 Mär 13 17:45 /var/run/exim4/exim.pid
ballon:~# cat /var/run/exim4/exim.pid 
28446

It seems, that the pid file is simply overwritten with th new value and
a new process is started after the old one is stopped.

Step 4: we stop exim4 again
ballon:~# pidof exim4
28446
ballon:~# invoke-rc.d exim4 stop
[ ok ] Stopping MTA: exim4_listener.
ballon:~# pidof exim4
(return nothing)
ballon:~# ls -la /var/run/exim4/exim.pid 
-rw-r--r-- 1 root Debian-exim 6 Mär 13 17:45 /var/run/exim4/exim.pid
ballon:~# cat /var/run/exim4/exim.pid 
28446

Step 5: Now we try to restart exim4
ballon:~# invoke-rc.d exim4 restart
[....] Stopping MTA for restart:/sbin/start-stop-daemon: warning: failed to kill 28446: No such process
[ ok 4_listener.
[ ok ] Restarting MTA: exim4.
ballon:~# pidof exim4
29047
ballon:~# ls -la /var/run/exim4/exim.pid 
-rw-r--r-- 1 root Debian-exim 6 Mär 13 18:37 /var/run/exim4/exim.pid
ballon:~# cat /var/run/exim4/exim.pid 
29047

Step 6: Now we stop exim4, then we remove the old pid file followed by a try to restart exim4
ballon:~# pidof exim4
29047
ballon:~# invoke-rc.d exim4 stop
[ ok ] Stopping MTA: exim4_listener.
ballon:~# pidof exim4
(return nothing)
ballon:~# rm -f /var/run/exim4/exim.pid
ballon:~# invoke-rc.d exim4 restart
[ ok ] Stopping MTA for restart:.
[ ok ] Restarting MTA: exim4.
ballon:~# pidof exim4
29683
ballon:~# ls -la /var/run/exim4/exim.pid 
-rw-r--r-- 1 root Debian-exim 6 Mär 13 19:38 /var/run/exim4/exim.pid
ballon:~# cat /var/run/exim4/exim.pid 
29683

The problem seems to be the way the init script /etc/init/d/exim4 checks if exim4 is running.

Cheers, Christian

-- Package-specific info:
Exim version 4.80 #3 built 02-Jan-2013 18:59:25
Copyright (c) University of Cambridge, 1995 - 2012
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2012
Berkeley DB: Berkeley DB 5.1.29: (October 25, 2011)
Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
Configuration file is /var/lib/exim4/config.autogenerated
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='satellite'
dc_other_hostnames='ballon.fritz.box'
dc_local_interfaces='127.0.0.1'
dc_readhost='ballon.fritz.box'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='mailhost.tu-chemnitz.de'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
mailname:ballon.fritz.box

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages exim4 depends on:
ii  debconf [debconf-2.0]  1.5.49
ii  exim4-base             4.80-7
ii  exim4-daemon-light     4.80-7

exim4 recommends no packages.

exim4 suggests no packages.

-- debconf information:
  exim4/drec:



More information about the Pkg-exim4-maintainers mailing list