Package: hyperestraier
Version: 1.4.1-1
Severity: normal
After a system crash hyperstraier fails to start detecting $ROOTDIR/_pid
is present even though that process is not valid anymore.
At that point if you try to stop the daemon, like shutting down the system
before
deleting the pid file the whole shutdown process freezes.
To reproduce this, start an usual hyperestraier instance, kill
the corresponding process and try to start/stop the daemon.
Attached is a patch with a fix for this issue.
Radu Spineanu
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-k7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages hyperestraier depends on:
ii libc6 2.3.6.ds1-4 GNU C Library: Shared libraries
ii libestraier8 1.4.1-1 a full-text search system Librarie
ii libfcgi0 2.4.0-5 Shared library of FastCGI
ii libqdbm14 1.8.70-1 QDBM Database Libraries [runtime]
ii zlib1g 1:1.2.3-13 compression library - runtime
Versions of packages hyperestraier recommends:
ii poppler-utils [xpdf-utils] 0.4.5-4.1 PDF utilitites (based on libpopple
pn ppthtml <none> (no description available)
pn wv <none> (no description available)
pn xlhtml <none> (no description available)
-- no debconf information
--- hyperestraier.old 2006-09-07 02:17:42.432712304 +0300
+++ hyperestraier 2006-09-07 02:37:30.017172024 +0300
@@ -17,6 +17,19 @@
test -x $DAEMON || exit 0
+# check if $ROOTDIR/_pid is a valid process and if it isn't deletes the pid
file
+check_process() {
+ pidfile="${ROOTDIR}/_pid"
+ if [ -f $pidfile ]; then
+ pid=`cat ${pidfile}`
+ process=`ps -p ${pid} | grep 'estmaster'` || true
+ if [ -z "$process" ]; then
+ rm "${ROOTDIR}/_pid"
+ fi
+
+ fi
+}
+
VERBOSE=yes
# Include hyperestraier defaults if available
if [ -f /etc/default/hyperestraier ] ; then
@@ -49,12 +62,14 @@
case "$1" in
start)
echo -n "Starting $DESC: "
+ check_process
start-stop-daemon --start --quiet --chuid $USER \
--exec $DAEMON -- start -bg $ROOTDIR
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
+ check_process
estmaster stop $ROOTDIR || true
echo "$NAME."
;;
@@ -77,6 +92,7 @@
# just the same as "restart".
#
echo -n "Restarting $DESC: "
+ check_process
estmaster stop $ROOTDIR || true
sleep 1
start-stop-daemon --start --quiet --chuid $USER \