mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Check status from init script if possible
This commit is contained in:
@@ -214,6 +214,7 @@ apply_ecannot=You are not allowed to apply the configuration
|
||||
stop_err=Failed to stop LDAP server
|
||||
stop_ecmd=$1 failed : $2
|
||||
stop_egone=No longer running!
|
||||
stop_egone2=Running but PID is unknown!
|
||||
stop_ekill=Kill process failed : $1
|
||||
stop_ecannot=You are not allowed to stop the LDAP server
|
||||
|
||||
|
||||
@@ -526,6 +526,7 @@ if ($config{'stop_cmd'}) {
|
||||
else {
|
||||
local $pid = &is_ldap_server_running();
|
||||
$pid || return $text{'stop_egone'};
|
||||
$pid > 1 || return $text{'stop_egone2'};
|
||||
return kill('TERM', $pid) ? undef : &text('stop_ekill', $!);
|
||||
}
|
||||
}
|
||||
@@ -564,6 +565,9 @@ else {
|
||||
# Returns the process ID of the running LDAP server, or undef
|
||||
sub is_ldap_server_running
|
||||
{
|
||||
&foreign_require("init");
|
||||
my $iname = $config{'init_name'} || $module_name;
|
||||
return 1 if (&init::status_action($iname) == 1);
|
||||
local $pidfile = &get_ldap_server_pidfile();
|
||||
if ($pidfile) {
|
||||
return &check_pid_file($pidfile);
|
||||
|
||||
Reference in New Issue
Block a user