Skip to content

Commit d5ca966

Browse files
try this
1 parent 9ea807a commit d5ca966

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pioreactorui/tasks.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ def initialized():
7373
def pio_run(*args: str, env: dict[str, str] = {}) -> bool:
7474
# for long running pio run jobs where we don't care about the output / status
7575
command = ("nohup", PIO_EXECUTABLE, "run") + args
76+
77+
command = (
78+
"systemd-run",
79+
"--scope",
80+
"--user", # optional: run as a user unit
81+
"-p",
82+
"KillSignal=SIGTERM",
83+
"-p",
84+
"TimeoutStopSec=30",
85+
PIO_EXECUTABLE,
86+
"run",
87+
) + args
88+
7689
env = {k: v for k, v in (env or {}).items() if k in ALLOWED_ENV}
7790
logger.info(f"Executing `{join(command)}`, {env=}")
7891
Popen(
@@ -108,7 +121,6 @@ def update_app_from_release_archive_across_cluster(archive_location: str, units:
108121
logger.info(f"Updating app on leader from {archive_location}")
109122
update_app_on_leader = ["pio", "update", "app", "--source", archive_location]
110123
check_call(update_app_on_leader)
111-
# remove bits if success
112124

113125
logger.info(f"Updating app and ui on workers from {archive_location}")
114126
distribute_archive_to_workers = [PIOS_EXECUTABLE, "cp", archive_location, "-y"]

0 commit comments

Comments
 (0)