wip
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user