Properly pass exit code from exec
This commit is contained in:
parent
3940c87fdf
commit
a5d53c0a7b
29
jlmkr.py
29
jlmkr.py
|
@ -223,20 +223,21 @@ def exec_jail(jail_name, cmd, args):
|
||||||
"""
|
"""
|
||||||
Execute a command in the jail with given name.
|
Execute a command in the jail with given name.
|
||||||
"""
|
"""
|
||||||
subprocess.run(
|
sys.exit(
|
||||||
[
|
subprocess.run(
|
||||||
"systemd-run",
|
[
|
||||||
"--machine",
|
"systemd-run",
|
||||||
jail_name,
|
"--machine",
|
||||||
"--quiet",
|
jail_name,
|
||||||
"--pipe",
|
"--quiet",
|
||||||
"--wait",
|
"--pipe",
|
||||||
"--collect",
|
"--wait",
|
||||||
"--service-type=exec",
|
"--collect",
|
||||||
cmd,
|
"--service-type=exec",
|
||||||
]
|
cmd,
|
||||||
+ args,
|
]
|
||||||
check=True,
|
+ args
|
||||||
|
).returncode
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue