diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2012-03-17 17:54:32 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2012-03-17 17:54:32 +0100 |
commit | 71292b558a9c1be6eacf3da3355ae0ac99c7e46e (patch) | |
tree | 812507675dccd78799815e5258c169660d36efc6 /debian | |
parent | 332e382bff5b9127db010a245fd9213386cc8d0c (diff) | |
download | apache2-71292b558a9c1be6eacf3da3355ae0ac99c7e46e.tar.gz |
guess MPM from .load file if config is broken
Diffstat (limited to 'debian')
-rwxr-xr-x | debian/a2enmod | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/debian/a2enmod b/debian/a2enmod index 74c49cb9..bd659c0a 100755 --- a/debian/a2enmod +++ b/debian/a2enmod @@ -346,9 +346,26 @@ sub remove_link { sub threaded { my $result = ""; $result = qx{/usr/sbin/apache2ctl -V | grep 'threaded'} if -x '/usr/sbin/apache2ctl'; + if ($? != 0) { + # config doesn't work + if ( -e "$enabldir/mpm_prefork.load" || -e "$enabldir/mpm_itk.load" ) { + return 0; + } + elsif ( -e "$enabldir/mpm_worker.load" || -e "$enabldir/mpm_event.load" ) { + return 1; + } + else { + error("Can't determine enabled MPM"); + # do what user requested + return 0; + } + } if ( $result =~ / no/ ) { return 0; } + elsif ( $result =~ / yes/ ) { + return 1; + } else { return 1; } |