Submission type
systemd version the issue has been seen with
Used distribution
Description
machinectl shell should forward the exit code of the process that it spawned inside the container. This makes it easier to use machinectl inside of scripts.
Current behavior
# machinectl shell <name> /bin/sh -c 'exit 1'
Connected to machine <name> Press ^] three times within 1s to exit session.
Connection to machine <name> terminated.
$ echo $?
0
Requested bahvior
# machinectl shell <name> /bin/sh -c 'exit 1'
Connected to machine <name> Press ^] three times within 1s to exit session.
Connection to machine <name> terminated.
$ echo $?
1