[Dev OpenGP] [105] bugfix in init script

[ Thread Index | Date Index | More opengp.tuxfamily.org/development Archives ]


Revision: 105
Author:   nicolaf
Date:     2009-03-26 17:07:55 +0100 (Thu, 26 Mar 2009)

Log Message:
-----------
bugfix in init script

Modified Paths:
--------------
    trunk/src/bin/init.d_daemon
    trunk/src/bin/ogpdaemon


Modified: trunk/src/bin/init.d_daemon
===================================================================
--- trunk/src/bin/init.d_daemon	2009-03-26 14:55:03 UTC (rev 104)
+++ trunk/src/bin/init.d_daemon	2009-03-26 16:07:55 UTC (rev 105)
@@ -16,11 +16,13 @@
 DAEMON="./ogpdaemon"
 NAME="OGP daemon"
 
-
 set -e
 
 error() {
 	echo $1
+	if [ -f "$PIDFILE" ];then
+		rm "$PIDFILE"
+	fi
 	exit 1
 }
 
@@ -31,11 +33,7 @@
 			exit 1
 		fi
 		echo -n "Starting $NAME... "
-		$DAEMON > $PIDFILE
-		if [ -z `cat "$PIDFILE"` ];then
-			rm "$PIDFILE"
-			error "failed!"
-		fi
+		$DAEMON > $PIDFILE || error "failed!"
 		echo "OK."
 		exit 0
 	;;

Modified: trunk/src/bin/ogpdaemon
===================================================================
--- trunk/src/bin/ogpdaemon	2009-03-26 14:55:03 UTC (rev 104)
+++ trunk/src/bin/ogpdaemon	2009-03-26 16:07:55 UTC (rev 105)
@@ -58,7 +58,7 @@
 	except:
 		usage()
 		sys.exit(2)
-	loglevels=[logging.WARNING, logging.INFO, logging.DEBUG]
+	loglevels=[logging.INFO, logging.WARNING, logging.DEBUG]
 	
 	loglevel=0
 	reload=False


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/