コード例 #1
0
function SingleInstance_reload()
{
    $unix = new unix();
    SingleInstance();
    $pid = SingleInstance_pid();
    if ($unix->process_exists($pid)) {
        $timepid = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["OUTPUT"]) {
            echo "{$GLOBALS["deflog_start"]} reloading executed {$pid} since {$timepid}Mn...\n";
        }
        unix_system_HUP($pid);
        sleep(2);
        $pid = SingleInstance_pid();
        if (!$unix->process_exists($pid)) {
            SingleInstance_start(true);
        }
        return;
    }
    SingleInstance_start(true);
}
コード例 #2
0
function SingleInstance_reload()
{
    $unix = new unix();
    SingleInstance();
    $pid = SingleInstance_pid();
    if ($unix->process_exists($pid)) {
        $timepid = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["OUTPUT"]) {
            echo "{$GLOBALS["deflog_start"]} reloading executed {$pid} since {$timepid}Mn...\n";
        }
        unix_system_HUP($pid);
        sleep(2);
        $pid = SingleInstance_pid();
        if (!$unix->process_exists($pid)) {
            SingleInstance_start(true);
        }
        return;
    }
    $PHP = $unix->LOCATE_PHP5_BIN();
    $nohup = $unix->find_program("nohup");
    shell_exec("{$nohup} {$PHP} /usr/share/artica-postfix/exec.spamassassin.php --whitelist >/dev/null 2>&1 &");
    SingleInstance_start(true);
}