mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
inc: don't send signal to stale process; fixes #159
This commit is contained in:
parent
941321debe
commit
c46cee4520
@ -37,7 +37,7 @@ function killbyname($procname, $sig = 'TERM')
|
||||
|
||||
function killbypid($pidfile, $sig = 'TERM')
|
||||
{
|
||||
if (!file_exists($pidfile)) {
|
||||
if (!isvalidpid($pidfile)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -46,12 +46,11 @@ function killbypid($pidfile, $sig = 'TERM')
|
||||
|
||||
function isvalidpid($pidfile)
|
||||
{
|
||||
$output = "";
|
||||
if (file_exists($pidfile)) {
|
||||
exec("/bin/pgrep -nF {$pidfile}", $output, $retval);
|
||||
return (intval($retval) == 0);
|
||||
if (!file_exists($pidfile)) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
return mwexecf('/bin/pgrep -nF %s', $pidfile) == 0;
|
||||
}
|
||||
|
||||
function is_process_running($process)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user