Skip to content

tcli run orphans game processes upon termination #84

@krujroom

Description

@krujroom

After staring a game with tcli run, the tcli process will orphan the game process upon termination.

Expected Behavior

After running a game with tcli run, terminating the tcli process (e.g. Ctrl+C, SIGTERM/SIGKILL) should also terminate the game process.

Current Behavior

The game process remains running as an orphan process after the tcli run process is terminated.

Steps to Reproduce

  1. Start a managed game with tcli e.g. tcli.exe run {game identifier}
  2. Verify both the tcli and game process are running:
$ ps o pid,ppid,pgid,sid,start,time,cmd --forest
   PID    PPID    PGID    SID  STARTED     TIME CMD
142557  142556  142557  142557 00:17:29 00:00:00 -bash
142913  142557  142913  142557 00:34:16 00:00:00  \_ tcli run -- -name ModdedTest ..
142929  142913  142913  142557 00:34:17 00:00:02      \_ /home/valheim/valheim/server/valheim_server.x86_64 -name ModdedTest ...
  1. Terminate the tcli process (e.g. pressing Ctrl+C in a shell or sending SIGTERM/SIGKILL with kill)
  2. Verify the tcli process is terminated, but the game process is running and orphaned:
$ ps o pid,ppid,pgid,sid,start,time,cmd --forest
    PID    PPID    PGID     SID  STARTED     TIME CMD
 142929       1  142913  142557 00:34:17 00:02:45 /home/valheim/valheim/server/valheim_server.x86_64 -name ModdedTest ...

Workaround

Manually terminate the game process with kill e.g. kill 142929 in example above.

Context (Environment)

Running tcli 0.2.0 with tcli-bepinex-installer 0.1.0 (compiled with an older glibc version) on Debian GNU/Linux 11 (bullseye)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions