From 30dd5eb41e47b4ce6103c2fff94cebc123a49677 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 3 Dec 2013 15:58:01 -0800 Subject: [PATCH] Don't try to run apachectl if path is not defined http://virtualmin.com/node/31403 --- apache/apache-lib.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apache/apache-lib.pl b/apache/apache-lib.pl index 840b9e2b9..10fc3adfe 100755 --- a/apache/apache-lib.pl +++ b/apache/apache-lib.pl @@ -1753,13 +1753,16 @@ foreach $l (&find_directive_struct("LoadModule", $conf)) { undef(@get_config_cache); # Cache is no longer valid # Add dynamically loaded modules -&open_execute_command(APACHE, "$config{'apachectl_path'} -M 2>/dev/null", 1); -while() { - if (/(\S+)_module/ && -r "$module_root_directory/mod_${1}.pl") { - push(@rv, "mod_${1}"); +if ($config{'apachectl_path'}) { + &open_execute_command(APACHE, + "$config{'apachectl_path'} -M 2>/dev/null", 1); + while() { + if (/(\S+)_module/ && -r "$module_root_directory/mod_${1}.pl") { + push(@rv, "mod_${1}"); + } } + close(APACHE); } -close(APACHE); return &unique(@rv); }