[Pkg-mono-svn-commits] rev 1259 - xsp/trunk/debian

Pablo Fischer pabl0-guest@haydn.debian.org
Tue, 13 Jul 2004 09:14:08 -0600


Author: pabl0-guest
Date: 2004-07-13 09:13:53 -0600 (Tue, 13 Jul 2004)
New Revision: 1259

Modified:
   xsp/trunk/debian/mono-xsp-update.conf
   xsp/trunk/debian/mono-xsp.dirs
   xsp/trunk/debian/mono-xsp.init
   xsp/trunk/debian/mono-xsp.postinst
   xsp/trunk/debian/mono-xsp.preinst
   xsp/trunk/debian/mono-xsp.prerm
Log:
Daemon is moved to /var/run/mono-xsp/mono-xsp.pid and /var/run/mono-xsp is now 
the SHARED_DIR of xsp


Modified: xsp/trunk/debian/mono-xsp-update.conf
===================================================================
--- xsp/trunk/debian/mono-xsp-update.conf	2004-07-11 20:00:17 UTC (rev 1258)
+++ xsp/trunk/debian/mono-xsp-update.conf	2004-07-13 15:13:53 UTC (rev 1259)
@@ -50,7 +50,7 @@
 $monoxsp_confd = "$monoxsp_dir/conf.d";
 $monoxsp_webapp = "$monoxsp_dir/debian.webapp";
 $daemon = "/etc/init.d/mono-xsp";
-$daemon_pid = "/var/run/mono-xsp";
+$daemon_pid = "/var/run/mono-xsp/mono-xsp.pid";
 $applications = "";
 $default_file = "/etc/default/mono-xsp";
 

Modified: xsp/trunk/debian/mono-xsp.dirs
===================================================================
--- xsp/trunk/debian/mono-xsp.dirs	2004-07-11 20:00:17 UTC (rev 1258)
+++ xsp/trunk/debian/mono-xsp.dirs	2004-07-13 15:13:53 UTC (rev 1259)
@@ -3,5 +3,5 @@
 etc/xsp/conf.d
 usr/share/dotnet/bin
 usr/share/dotnet/xsp
+var/run/mono-xsp
 
-

Modified: xsp/trunk/debian/mono-xsp.init
===================================================================
--- xsp/trunk/debian/mono-xsp.init	2004-07-11 20:00:17 UTC (rev 1258)
+++ xsp/trunk/debian/mono-xsp.init	2004-07-13 15:13:53 UTC (rev 1259)
@@ -15,6 +15,7 @@
 DEFAULT=/etc/default/$NAME
 CFGDIR=/etc/xsp
 VIRTUALFILE=$CFGDIR/debian.webapp
+MONO_SHARED_DIR=/var/run/$NAME
 
 test -x $DAEMON || exit 0
 
@@ -25,9 +26,9 @@
 	return 1
     fi 
     
-    if [ -f /var/run/$NAME ]; then
+    if [ -f /var/run/$NAME/$NAME.pid ]; then
 	# Are we really running xsp?
-	xsp_pid=`cat /var/run/$NAME`
+	xsp_pid=`cat /var/run/$NAME/$NAME.pid`
 	xsp_ps=`ps -p $xsp_pid | wc -l`
 	if [ "$xsp_ps" != "1" ]; then
 	    echo "Sorry, there is already a xsp running, stop it first"
@@ -39,9 +40,9 @@
 }
 
 should_stop() {
-    if [ -f /var/run/$NAME ]; then
+    if [ -f /var/run/$NAME/$NAME.pid ]; then
 	# Are we really running xsp?
-	xsp_pid=`cat /var/run/$NAME`
+	xsp_pid=`cat /var/run/$NAME/$NAME.pid`
 	xsp_ps=`ps -p $xsp_pid | wc -l`
 	# Are there any process running by that pid?
 	if [ "$xsp_ps" = "2" ]; then
@@ -59,8 +60,9 @@
 	if should_start ; then
 	    . $DEFAULT	
 	    echo -n "Starting $DESC: $NAME"
+	    export MONO_SHARED_DIR
 	    start-stop-daemon --start --background --make-pidfile \
-		--quiet --pidfile /var/run/$NAME \
+		--quiet --pidfile /var/run/$NAME/$NAME.pid \
 		--user $user --group $group --chuid $user \
 		--exec $DAEMON -- \
 		--port $port --appconfigdir $CFGDIR --nonstop
@@ -70,7 +72,7 @@
     stop)
 	if should_stop ; then
 	    echo -n "Stopping $DESC: $NAME "
-	    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
+	    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME/$NAME.pid
 	    echo "."
 	fi
 	;;
@@ -83,15 +85,16 @@
 	
 	if should_stop ; then
 	    echo "Restarting $DESC: $NAME"	
-	    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME
+	    start-stop-daemon --stop --quiet --pidfile /var/run/$NAME/$NAME.pid
 	    sleep 1
 	fi
 	
 	if should_start ; then
 	    . $DEFAULT	
 	    echo "Starting $DESC: $NAME"
+	    export MONO_SHARED_DIR
 	    start-stop-daemon --start --background --make-pidfile \
-		--quiet --pidfile /var/run/$NAME \
+		--quiet --pidfile /var/run/$NAME/$NAME.pid \
 		--user $user --group $group --chuid $user \
 		--exec $DAEMON -- \
 		--port $port --appconfigdir $CFGDIR --nonstop

Modified: xsp/trunk/debian/mono-xsp.postinst
===================================================================
--- xsp/trunk/debian/mono-xsp.postinst	2004-07-11 20:00:17 UTC (rev 1258)
+++ xsp/trunk/debian/mono-xsp.postinst	2004-07-13 15:13:53 UTC (rev 1259)
@@ -50,9 +50,9 @@
 	return 1
     fi 
     
-    if [ -f /var/run/$NAME ]; then
+    if [ -f /var/run/$NAME/$NAME.pid ]; then
 	# Are we really running xsp?
-	xsp_pid=`cat /var/run/$NAME`
+	xsp_pid=`cat /var/run/$NAME/$NAME.pid`
 	xsp_ps=`ps -p $xsp_pid | wc -l`
 	if [ "$xsp_ps" != "2" ]; then
 	    return 0
@@ -93,6 +93,8 @@
 	    echo "XSP is going to use the port 8080 (default)"
 	fi
 
+	#chmod dir
+	chown -R www-data.www-data /var/run/mono-xsp
 	mono-xsp-update.conf
 	if [ "$RET" = "true" ]; then
 	    if should_start -a $autostart = "true" ; then

Modified: xsp/trunk/debian/mono-xsp.preinst
===================================================================
--- xsp/trunk/debian/mono-xsp.preinst	2004-07-11 20:00:17 UTC (rev 1258)
+++ xsp/trunk/debian/mono-xsp.preinst	2004-07-13 15:13:53 UTC (rev 1259)
@@ -4,9 +4,9 @@
 DESC="XSP WebServer"
 
 should_stop() {
-    if [ -f /var/run/$NAME ]; then
+    if [ -f /var/run/$NAME/$NAME.pid ]; then
         # Are we really running xsp?
-	xsp_pid=`cat /var/run/$NAME`
+	xsp_pid=`cat /var/run/$NAME/$NAME.pid`
 	xsp_ps=`ps -p $xsp_pid | wc -l`
 	# Are there any process running by that pid?
 	if [ "$xsp_ps" = "2" ]; then

Modified: xsp/trunk/debian/mono-xsp.prerm
===================================================================
--- xsp/trunk/debian/mono-xsp.prerm	2004-07-11 20:00:17 UTC (rev 1258)
+++ xsp/trunk/debian/mono-xsp.prerm	2004-07-13 15:13:53 UTC (rev 1259)
@@ -6,9 +6,9 @@
 #0 : false
 #1 : true
 should_stop() {
-    if [ -f /var/run/$NAME ]; then
+    if [ -f /var/run/$NAME/$NAME.pid ]; then
 	# Are we really running xsp?
-	xsp_pid=`cat /var/run/$NAME`
+	xsp_pid=`cat /var/run/$NAME/$NAME.pid`
 	xsp_ps=`ps -p $xsp_pid | wc -l`
 	# Are there any process running by that pid?
 	if [ "$xsp_ps" = "2" ]; then