mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Fix squid PID detection
https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3459413&group_id=17457
This commit is contained in:
@@ -342,19 +342,29 @@ else {
|
||||
sub is_squid_running
|
||||
{
|
||||
local $conf = &get_config();
|
||||
local ($pidstruct, $pidfile);
|
||||
$pidstruct = &find_config("pid_filename", $conf);
|
||||
if (!$pidstruct) {
|
||||
$pidstruct = &find_config("pid_filename", $conf, 2);
|
||||
|
||||
# Find all possible PID files
|
||||
local @pidfiles;
|
||||
local $pidstruct = &find_config("pid_filename", $conf);
|
||||
push(@pidfiles, $pidstruct->{'values'}->[0]) if ($pidstruct);
|
||||
local $def_pidstruct = &find_config("pid_filename", $conf);
|
||||
push(@pidfiles, $def_pidstruct->{'values'}->[0]) if ($def_pidstruct);
|
||||
push(@pidfiles, $config{'pid_file'}) if ($config{'pid_file'});
|
||||
@pidfiles = grep { $_ ne "none" } @pidfiles;
|
||||
|
||||
# Try check one
|
||||
foreach my $pidfile (@pidfiles) {
|
||||
my $pid = &check_pid_file($pidfile);
|
||||
return $pid if ($pid);
|
||||
}
|
||||
$pidfile = $pidstruct ? $pidstruct->{'values'}->[0] : $config{'pid_file'};
|
||||
if ($pidfile eq "none" || !$pidfile) {
|
||||
|
||||
if (!@pidfiles) {
|
||||
# Fall back to checking for Squid process
|
||||
local ($pid) = &find_byname("squid");
|
||||
return $pid;
|
||||
}
|
||||
else {
|
||||
return &check_pid_file($pidfile);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
# this_url()
|
||||
|
||||
Reference in New Issue
Block a user