[Pkg-mono-svn-commits] rev 386 - libapache-mod-mono/trunk/debian

Pablo Fischer pabl0-guest@quantz.debian.org
Sun, 29 Feb 2004 09:50:52 +0100


Author: pabl0-guest
Date: 2004-02-29 09:50:51 +0100 (Sun, 29 Feb 2004)
New Revision: 386

Modified:
   libapache-mod-mono/trunk/debian/libapache-mod-mono.postinst
   libapache-mod-mono/trunk/debian/libapache-mod-mono.prerm
   libapache-mod-mono/trunk/debian/mono.conf
   libapache-mod-mono/trunk/debian/rules
Log:
* libapache-mod-mono.postinst:
  + Added two functions: restart_apache and restart_monoserver. The
    first one will verify if apache is already running, if it is, we 
    should restart it to read the new configuration, the second verify if
    mono-server should be started now reading the /default/ file
* libapache-mod-mono.prerm:
  + Added two functions as in postinst, the difference is that in 
    restart_monoserver, it should stop the server ONLY if it's running,
    there's no need to stop it twice.
* mono.conf:
  + Added the DirectoryIndex. If we are running apache with mod_mono, 
    the best idea is to show first the index.aspx as the index page.
* rules:
  + We create the full parent directories to /etc/apache/conf.d.
  + Instead of installing the files, we should copy them :)



Modified: libapache-mod-mono/trunk/debian/libapache-mod-mono.postinst
===================================================================
--- libapache-mod-mono/trunk/debian/libapache-mod-mono.postinst	2004-02-29 08:39:44 UTC (rev 385)
+++ libapache-mod-mono/trunk/debian/libapache-mod-mono.postinst	2004-02-29 08:50:51 UTC (rev 386)
@@ -32,6 +32,30 @@
                 cp -f $tempfile $modmono_conf
 }
 
+restart_apache() {
+    #Apache is already running?
+    if [ -f /var/run/mono-server ]; then
+        # Are we really running apache?
+	apache_pid=`cat /var/run/apache.pid`
+	apache_ps=`ps -p $apache_pid | wc -l`
+ 	# Are there any process running by that pid?
+	if [ $apache_ps != "1" ]; then
+	    /etc/init.d/apache restart
+	fi
+    fi
+
+}
+
+restart_monoserver() {
+    #Can we start the mono-server?
+    start_monoserver=`grep start_boot /etc/default/mono-server | awk -F '=' '{ print $2}'`
+    if [ $start_monoserver = "true" ]; then
+        # Ok, start it..
+	/etc/init.d/mono-server start
+    fi    
+}
+
+
 case "$1" in
     configure)
     db_get libapache-mod-mono/activate
@@ -42,12 +66,16 @@
         if `cat $modmono_conf | grep -xq "#AddType^"`; then
             turnon_type
         fi
+	restart_apache
+	restart_monoserver
     else
-        if `cat $apachecfg/conf.d/mono.conf | grep -xq "AddType^"`; then
+        if `cat $modmono_conf | grep -xq "AddType^"`; then
             turnoff_type
         fi
     fi
 
+    
+    # Should we restart Apache?
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)

Modified: libapache-mod-mono/trunk/debian/libapache-mod-mono.prerm
===================================================================
--- libapache-mod-mono/trunk/debian/libapache-mod-mono.prerm	2004-02-29 08:39:44 UTC (rev 385)
+++ libapache-mod-mono/trunk/debian/libapache-mod-mono.prerm	2004-02-29 08:50:51 UTC (rev 386)
@@ -13,9 +13,39 @@
 
 }
 
+
+restart_apache() {
+    #Apache is already running?
+    if [ -f /var/run/mono-server ]; then
+        # Are we really running apache?
+	apache_pid=`cat /var/run/apache.pid`
+	apache_ps=`ps -p $apache_pid | wc -l`
+ 	# Are there any process running by that pid?
+	if [ $apache_ps != "1" ]; then
+	    /etc/init.d/apache restart
+	fi
+    fi
+}
+
+restart_monoserver() {
+    #MonoServer is running?
+    if [ -f /var/run/mono-server ]; then
+        # Are we really running xsp?
+	monoserver_pid=`cat /var/run/mono-server`
+	monoserver_ps=`ps -p $monoserver_pid | wc -l`
+ 	# Are there any process running by that pid?
+	if [ $xsp_ps != "1" ]; then
+	    #Ok.. is recommended to start it, but, should we do this?, NO!
+	    /etc/init.d/mono-server stop
+	fi
+    fi
+}
+
 case "$1" in
   remove)
         turnoff_module
+	restart_apache
+	restart_monoserver
         ;;
     upgrade | deconfigure | failed-upgrade)
         :

Modified: libapache-mod-mono/trunk/debian/mono.conf
===================================================================
--- libapache-mod-mono/trunk/debian/mono.conf	2004-02-29 08:39:44 UTC (rev 385)
+++ libapache-mod-mono/trunk/debian/mono.conf	2004-02-29 08:50:51 UTC (rev 386)
@@ -4,7 +4,7 @@
 <IfModule mod_mono.c>
 	AddType application/x-asp-net .aspx .ashx .asmx .ascx .asax .config .ascx
 	MonoUnixSocket /tmp/.mono-server/mod_mono_server
-
+	DirectoryIndex index.aspx
 	# The ASP.NET examples directory, create an Alias
 	Alias /samples /usr/share/asp.net-demos/asp
 </IfModule>

Modified: libapache-mod-mono/trunk/debian/rules
===================================================================
--- libapache-mod-mono/trunk/debian/rules	2004-02-29 08:39:44 UTC (rev 385)
+++ libapache-mod-mono/trunk/debian/rules	2004-02-29 08:50:51 UTC (rev 386)
@@ -68,9 +68,10 @@
 
 	# Add here commands to install the package into debian/libapache-mod-mono.
 	$(MAKE) install DESTDIR=$(CURDIR)/debian/libapache-mod-mono
-	install -m644 $(CURDIR)/debian/500mod_mono.info $(APACHELIB)/500mod_mono.info
-	install -m644 $(CURDIR)/debian/mono.conf $(APACHEETC)/mono.conf
 
+	mkdir -p $(APACHEETC)
+	cp -f $(CURDIR)/debian/500mod_mono.info $(APACHELIB)/500mod_mono.info
+	cp -f $(CURDIR)/debian/mono.conf $(APACHEETC)/mono.conf
 
 # Build architecture-independent files here.
 binary-indep: build install