I had heimdal-0.7 installed, with /usr/sbin/kdc running. I installed heimdal-0.6.5 while it was running. Afterwards, "/etc/init.d/heimdal-kdc stop" wouldn't work anymore (shows [ !! ]). Now I get: olympia ~ # start-stop-daemon --stop --exec /usr/sbin/kdc No /usr/sbin/kdc found running; none killed. olympia ~ # ls /proc/*/exe -l 2> /dev/null | grep kdc lrwxrwxrwx 1 root root 0 Jul 31 13:19 /proc/25437/exe -> /var/tmp/portage/heimdal-0.6.5/image/usr/sbin/kdc (deleted) olympia ~ # ps auxw | grep 25437 root 25437 0.0 0.1 4996 2032 ? Ss 11:42 0:00 /usr/sbin/kdc --detach I had similar symptoms with openafs before, but I didn't investigate the /proc then. Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r1, 2.6.12-gentoo-r4 i686) ================================================================= System uname: 2.6.12-gentoo-r4 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5, 2.4.1-r1 sys-apps/sandbox: 1.2.11 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-O3 -march=pentium4 -fomit-frame-pointer -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks nostrip sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" LINGUAS="en_US de en_GB fr nl zh_CN zh_TW" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/ownportage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X afs alsa apm arts avi berkdb bitmap-fonts cdr cjk crypt cups curl eds emboss encode esd f77 fam flac foomaticdb fortran gd gdbm gif gnome gphoto2 gpm gstreamer gtk gtk2 imagemagick imlib ipv6 jack java jpeg jpeg2k junit kde libg++ libwww mad mikmod motif mozilla mp3 mpeg ncurses nis nls ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts vorbis xine xinerama xml2 xmms xv zlib linguas_en_US linguas_de linguas_en_GB linguas_fr linguas_nl linguas_zh_CN linguas_zh_TW userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, MAKEOPTS
It seems to me that "start-stop-daemon" only stops a process with --exec if the same binary still exists. This is because in /proc/${pid}/exe the link to "/usr/sbin/mydaemon" is replaced by "/usr/sbin/mydaemon (deleted)" whenever this file is moved off the filesystem. So, this could be regarded as a "feature" of start-stop-daemon, but it would mean that after an upgrade, every attempt to restart a service with "start-stop-daemon --exec" will fail. Does this mean we need to use --pidfile only to circumvent this? Maybe I'm looking at this the wrong way...
Looking further into this reveals that 1) I cannot reproduce this problem for heimdal anymore (possibly due to a change in basesystem) 2) The same problem still exists for openafs. There, the problem seems to be triggered by the use of "-o", which disables the script that simulates start-stop-daemon and goes straight to /sbin/start-stop-daemon. The built-in script seems to be robust against upgrades, the /sbin/start-stop-daemon version seems not.