Skip to content

RFE: Return exit code of process started with machinectl shell #4215

@wlhlm

Description

@wlhlm

Submission type

  • Bug report
  • Request for enhancement (RFE)

systemd version the issue has been seen with

  • 231

Used distribution

  • NixOS

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestmachine

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions