Merge branch 'ent-12274-pandora-gotty-no-se-levanta-automaticamente-con-el-cron-en-ubuntu' into 'develop'
fix pgrep process in ubuntu See merge request artica/pandorafms!6658
This commit is contained in:
commit
071427e60b
|
@ -459,17 +459,17 @@ function cron_task_start_gotty(bool $restart_mode=true)
|
||||||
|
|
||||||
// Check prev process running and kill it (only if port changed in setup params).
|
// Check prev process running and kill it (only if port changed in setup params).
|
||||||
if (empty($config['restart_gotty_next_cron_port']) === false) {
|
if (empty($config['restart_gotty_next_cron_port']) === false) {
|
||||||
config_update_value('restart_gotty_next_cron_port', '');
|
$prevProcessRunning = shell_exec("pgrep -af 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."' | grep -v 'pgrep'");
|
||||||
|
|
||||||
$prevProcessRunning = shell_exec("pgrep -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'");
|
|
||||||
|
|
||||||
if (empty($prevProcessRunning) === false) {
|
if (empty($prevProcessRunning) === false) {
|
||||||
shell_exec("pkill -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'");
|
shell_exec("pkill -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config_update_value('restart_gotty_next_cron_port', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if gotty is running on the configured port.
|
// Check if gotty is running on the configured port.
|
||||||
$processRunning = shell_exec("pgrep -f 'pandora_gotty.*-p ".$config['gotty_port']."'");
|
$processRunning = shell_exec("pgrep -af 'pandora_gotty.*-p ".$config['gotty_port']."' | grep -v 'pgrep'");
|
||||||
|
|
||||||
$start_proc = true;
|
$start_proc = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue