summaryrefslogtreecommitdiff
path: root/examples/unschroot_proc.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/unschroot_proc.py')
-rwxr-xr-xexamples/unschroot_proc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/unschroot_proc.py b/examples/unschroot_proc.py
index 96da4e5..e75b80b 100755
--- a/examples/unschroot_proc.py
+++ b/examples/unschroot_proc.py
@@ -718,7 +718,11 @@ class ContainerSupervisor(asyncvarlink.VarlinkInterface):
# The container may change this, but it's still useful for
# robustness when it does not.
linuxnamespaces.prctl_set_pdeathsig(signal.SIGKILL)
- os.execvp(command[0], command)
+ try:
+ os.execvp(command[0], command)
+ except OSError as err:
+ print(f"failed to exec {command[0]}: {err}", file=sys.stderr)
+ os._exit(127)
# The caller should call Terminate next. Doing so will close the wpipe
# and thus allow the child process to proceed.