This commit is contained in:
Your Name
2024-06-17 12:44:38 -05:00
parent c94dc803dd
commit 4c9c211f97

View File

@@ -51,13 +51,27 @@ def launcher(proc: str, name: str, log_path: str) -> None:
sentry.capture_exception()
raise
# def nativelauncher(pargs: list[str], cwd: str, name: str) -> None:
# os.environ['MANAGER_DAEMON'] = name
# global _log_dir
# log_path = _log_dir+"/"+self.name+".log"
# # exec the process
# os.chdir(cwd)
# os.execvp(pargs[0], pargs)
def nativelauncher(pargs: list[str], cwd: str, name: str) -> None:
os.environ['MANAGER_DAEMON'] = name
global _log_dir
log_path = os.path.join(_log_dir, f"{name}.log")
# exec the process
os.chdir(cwd)
os.execvp(pargs[0], pargs)
# Command construction
command = f"bash -c \"{ ' '.join(pargs) } 2>&1 | tee {log_path}\""
# Execute the command in the specified directory
subprocess.run(command, shell=True, cwd=cwd, executable='/bin/bash')
def join_process(process: Process, timeout: float) -> None: