Package: sqlrelay
Version: 1:0.37.1-3.1

When computer shut down unexpectedly (i.e. if electricity has gone),
it can not start with "/etc/init.d/sqlrelay start" command because of
some pid files. When i clear the pid files, it again does not start
because of uncelar ipc.

I've added an diff file attachment of /etc/init.d/sqlrelay (Careful:
it is not a patch file because i've changed the file name as
sqlrelay_orj). I solved the problem so; In the "start" case of file
first i'm checking the pid files from directory
/var/cache/sqlrelay/tmp/pids/ (I don't know why it should be hardcoded
but it is not configurable). And i'm testing each pid with ps. If i
could not found the processes, then i remove the files from directory
and cleaning ipc with sqlr-ipclean

Best regards...
--
Gurkan ASLAN (a.k.a. Integer)
Software Developer
--- sqlrelay_orj	2007-06-19 15:40:55.000000000 +0300
+++ sqlrelay	2007-06-19 15:41:10.000000000 +0300
@@ -50,6 +50,14 @@ case "$1" in
         if ( xmllint -noout --valid $j ); then
 	  OLDUMASK=`umask`
 	  umask 002
+	  for file in /var/cache/sqlrelay/tmp/pids/*
+	  do
+	  	if [ -f "$file" ] && ! ps `cat $file` > /dev/null 2>&1 
+	  	then 
+			rm -rf "$file"
+			/usr/bin/sqlr-ipclean
+	  	fi
+	  done
           su $RUNASUSER -c "/usr/bin/sqlr-start -id $i -config $j"
 	  umask $OLDUMASK
         else

Reply via email to