wfPrepare($pid); $logfile = $runfile->getLogfile() ?? "/tmp/NULIB_APP_app_start.log"; $exitcode = app2::EC_FORK_CHILD; try { # puis lancer la commande $cmd = new Cmd($args); $cmd->addSource("/g/init.env"); $cmd->addRedir("both", $logfile, true); $cmd->fork_exec($exitcode, false); sh::_waitpid(-$pid, $exitcode); } finally { $runfile->wfReaped($exitcode); } } } static function _stop(Runfile $runfile): bool { $data = $runfile->read(); $pid = $runfile->_getCid($data); msg::action("stop $pid"); if ($runfile->wfKill($reason)) { msg::asuccess(); return true; } else { msg::afailure($reason); return false; } } }