[Pkg-apache-commits] [SCM] Debian packaging for apache2 (Apache HTTPD 2.x) branch, next, updated. d45a03625ca7399ba492081c586fc31ee49a76dd

Arno Töll debian at toell.net
Thu Feb 2 23:40:53 UTC 2012


The following commit has been merged in the next branch:
commit c735579764d307e8cd1a4051841229e7e69d61a3
Author: Arno Töll <debian at toell.net>
Date:   Mon Jan 30 02:01:35 2012 +0100

    * Implement Conflicts header for module configuration files
    * Move MPM configuration from apache2.conf to their respective *.conf files
    * Provide MPM load/conf files
    * Load worker WPM by default

diff --git a/debian/a2enmod b/debian/a2enmod
index 89f76a6..da4b843 100755
--- a/debian/a2enmod
+++ b/debian/a2enmod
@@ -155,6 +155,11 @@ sub doit {
             $depends =~ s,^[\s\n]+,,;
             $depends =~ s,[\s\n]+$,,;
             do_deps( $acton, split( /[\n\s]+/, $depends ) ) or return 0;
+
+            my $conflicts = qx{grep "# Conflicts:" "$availdir/$acton.load"|cut -f2 -d:};
+            $conflicts =~ s,^[\s\n]+,,;
+            $conflicts =~ s,[\s\n]+$,,;
+            check_conflicts( $acton, split( /[\n\s]+/, $conflicts ) ) or return 0;
         }
         else {
             my @depends = qx{egrep "# Depends:.*${acton}( |\$)" $enabldir/*.load};
@@ -258,6 +263,30 @@ sub do_deps {
     return 1;
 }
 
+sub check_conflicts {
+    my $acton = shift;
+    my $haderror = 0;
+    foreach my $d (@_) {
+        info("Considering conflict $d for $acton:\n");
+
+        my $tgt  = "$availdir/$d$sffx";
+        my $link = "$enabldir/$d$sffx";
+
+        my $confcheck = check_link( $tgt, $link );
+        if ( $confcheck eq 'ok' ) {
+            error("Module $d is enabled - cannot proceed due to conflicts. It needs to be disabled first!\n");
+            # Don't return immediately, there could be several conflicts
+            $haderror++;
+        }
+    }
+
+    if ($haderror) {
+        return 0;
+    }
+
+    return 1;
+}
+
 sub add_link {
     my ( $tgt, $link ) = @_;
 
diff --git a/debian/apache2.postinst b/debian/apache2.postinst
index c4fdea1..d334ef7 100755
--- a/debian/apache2.postinst
+++ b/debian/apache2.postinst
@@ -18,6 +18,10 @@ set -e
 # the debian-policy package
 #
 
+enable_default_mpm()
+{
+	a2enmod -q mpm_worker
+}
 
 enable_default_modules()
 {
@@ -51,6 +55,8 @@ install_default_files()
 case "$1" in
         configure)
 
+	enable_default_mpm
+
 	install_default_files
 
         enable_default_modules
diff --git a/debian/changelog b/debian/changelog
index 682499e..bc6657b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -54,8 +54,14 @@ apache2 (2.3.16-beta-1) UNRELEASED; urgency=low
       synchronization files among modules
     + Update configuration to use the new IncludeOptional syntax
     + Enable these modules by default: authz_core authz_host alias cgi dir
-
- -- Arno Töll <debian at toell.net>  Fri, 27 Jan 2012 14:07:09 +0100
+    + Move MPM specific configuration to their respective configuration files.
+      Users can just load and unload MPMs like other modules, enable the worker
+      MPM by default
+  * Changes in a2enmod:
+    + Parse "Conflicts: " header to denote conflicts between modules which
+      cannot be loaded into the same Apache server.
+
+ -- Arno Töll <debian at toell.net>  Mon, 30 Jan 2012 02:02:37 +0100
 
 apache2 (2.2.21-6) UNRELEASED; urgency=low
 
diff --git a/debian/config-dir/apache2.conf b/debian/config-dir/apache2.conf
index 61995cc..c6948da 100644
--- a/debian/config-dir/apache2.conf
+++ b/debian/config-dir/apache2.conf
@@ -74,64 +74,6 @@ MaxKeepAliveRequests 100
 #
 KeepAliveTimeout 5
 
-##
-## Server-Pool Size Regulation (MPM specific)
-##
-
-#FIXME: Find something more generic to load all available MPMs upon request by
-# the user. This line is no way meant to be the final solution. 
-LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so
-
-# prefork MPM
-# StartServers: number of server processes to start
-# MinSpareServers: minimum number of server processes which are kept spare
-# MaxSpareServers: maximum number of server processes which are kept spare
-# MaxClients: maximum number of server processes allowed to start
-# MaxRequestsPerChild: maximum number of requests a server process serves
-<IfModule mpm_prefork_module>
-    StartServers          5
-    MinSpareServers       5
-    MaxSpareServers      10
-    MaxClients          150
-    MaxRequestsPerChild   0
-</IfModule>
-
-# worker MPM
-# StartServers: initial number of server processes to start
-# MinSpareThreads: minimum number of worker threads which are kept spare
-# MaxSpareThreads: maximum number of worker threads which are kept spare
-# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
-#              graceful restart. ThreadLimit can only be changed by stopping
-#              and starting Apache.
-# ThreadsPerChild: constant number of worker threads in each server process
-# MaxClients: maximum number of simultaneous client connections
-# MaxRequestsPerChild: maximum number of requests a server process serves
-<IfModule mpm_worker_module>
-    StartServers          2
-    MinSpareThreads      25
-    MaxSpareThreads      75 
-    ThreadLimit          64
-    ThreadsPerChild      25
-    MaxClients          150
-    MaxRequestsPerChild   0
-</IfModule>
-
-# event MPM
-# StartServers: initial number of server processes to start
-# MinSpareThreads: minimum number of worker threads which are kept spare
-# MaxSpareThreads: maximum number of worker threads which are kept spare
-# ThreadsPerChild: constant number of worker threads in each server process
-# MaxClients: maximum number of simultaneous client connections
-# MaxRequestsPerChild: maximum number of requests a server process serves
-<IfModule mpm_event_module>
-    StartServers          2
-    MinSpareThreads      25
-    MaxSpareThreads      75 
-    ThreadLimit          64
-    ThreadsPerChild      25
-    MaxClients          150
-    MaxRequestsPerChild   0
-</IfModule>
 
 # These need to be set in /etc/apache2/envvars
 User ${APACHE_RUN_USER}
diff --git a/debian/config-dir/mods-available/mpm_event.conf b/debian/config-dir/mods-available/mpm_event.conf
new file mode 100644
index 0000000..21e460c
--- /dev/null
+++ b/debian/config-dir/mods-available/mpm_event.conf
@@ -0,0 +1,17 @@
+# event MPM
+# StartServers: initial number of server processes to start
+# MinSpareThreads: minimum number of worker threads which are kept spare
+# MaxSpareThreads: maximum number of worker threads which are kept spare
+# ThreadsPerChild: constant number of worker threads in each server process
+# MaxClients: maximum number of simultaneous client connections
+# MaxRequestsPerChild: maximum number of requests a server process serves
+<IfModule mpm_event_module>
+    StartServers          2
+    MinSpareThreads      25
+    MaxSpareThreads      75 
+    ThreadLimit          64
+    ThreadsPerChild      25
+    MaxClients          150
+    MaxRequestsPerChild   0
+</IfModule>
+
diff --git a/debian/config-dir/mods-available/mpm_event.load b/debian/config-dir/mods-available/mpm_event.load
new file mode 100644
index 0000000..5bb4ba4
--- /dev/null
+++ b/debian/config-dir/mods-available/mpm_event.load
@@ -0,0 +1,2 @@
+# Conflicts: mpm_wprker mpm_prefork
+LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so
diff --git a/debian/config-dir/mods-available/mpm_prefork.conf b/debian/config-dir/mods-available/mpm_prefork.conf
new file mode 100644
index 0000000..d61ee1a
--- /dev/null
+++ b/debian/config-dir/mods-available/mpm_prefork.conf
@@ -0,0 +1,15 @@
+# prefork MPM
+# StartServers: number of server processes to start
+# MinSpareServers: minimum number of server processes which are kept spare
+# MaxSpareServers: maximum number of server processes which are kept spare
+# MaxClients: maximum number of server processes allowed to start
+# MaxRequestsPerChild: maximum number of requests a server process serves
+
+<IfModule mpm_prefork_module>
+    StartServers          5
+    MinSpareServers       5
+    MaxSpareServers      10
+    MaxClients          150
+    MaxRequestsPerChild   0
+</IfModule>
+
diff --git a/debian/config-dir/mods-available/mpm_prefork.load b/debian/config-dir/mods-available/mpm_prefork.load
new file mode 100644
index 0000000..05da7a3
--- /dev/null
+++ b/debian/config-dir/mods-available/mpm_prefork.load
@@ -0,0 +1,2 @@
+# Conflicts: mpm_event mpm_worker
+LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so
diff --git a/debian/config-dir/mods-available/mpm_worker.conf b/debian/config-dir/mods-available/mpm_worker.conf
new file mode 100644
index 0000000..3f77f11
--- /dev/null
+++ b/debian/config-dir/mods-available/mpm_worker.conf
@@ -0,0 +1,21 @@
+# worker MPM
+# StartServers: initial number of server processes to start
+# MinSpareThreads: minimum number of worker threads which are kept spare
+# MaxSpareThreads: maximum number of worker threads which are kept spare
+# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
+#              graceful restart. ThreadLimit can only be changed by stopping
+#              and starting Apache.
+# ThreadsPerChild: constant number of worker threads in each server process
+# MaxClients: maximum number of simultaneous client connections
+# MaxRequestsPerChild: maximum number of requests a server process serves
+
+<IfModule mpm_worker_module>
+    StartServers          2
+    MinSpareThreads      25
+    MaxSpareThreads      75 
+    ThreadLimit          64
+    ThreadsPerChild      25
+    MaxClients          150
+    MaxRequestsPerChild   0
+</IfModule>
+
diff --git a/debian/config-dir/mods-available/mpm_worker.load b/debian/config-dir/mods-available/mpm_worker.load
new file mode 100644
index 0000000..f9d0c4d
--- /dev/null
+++ b/debian/config-dir/mods-available/mpm_worker.load
@@ -0,0 +1,2 @@
+# Conflicts: mpm_event mpm_prefork
+LoadModule mpm_worker_module /usr/lib/apache2/modules/mod_mpm_worker.so

-- 
Debian packaging for apache2 (Apache HTTPD 2.x)



More information about the Pkg-apache-commits mailing list