Skip to content

toolbox run command isn't terminated properly when terminal emulator is exited #1157

Closed
@ghost

Description

Describe the bug

toolbox run command isn't terminated properly when terminal emulator is exited, causing processes to linger around without user's awareness.

Steps how to reproduce the behaviour

  1. Open System Monitor / Task Manager equivilent in your desktop environment
  2. Search for sleep
  3. Execute the following command in a terminal emulator (GNOME Terminal):
toolbox run sleep 30
  1. Before sleep runs out of time, try to close the terminal emulator
  2. It'll prompt for something like this:

image

Insist closing it by pressing Close Terminal.

Expected behaviour

sleep process is terminated.

Actual behaviour

sleep keeps lingering around.

Output of toolbox --version (v0.0.90+)

toolbox version 0.0.99.3

Toolbox package info (rpm -q toolbox)

toolbox-0.0.99.3-6.fc36.x86_64

Output of podman version

Client:       Podman Engine
Version:      4.2.1
API Version:  4.2.1
Go Version:   go1.18.5
Built:        Thu Sep  8 03:58:19 2022
OS/Arch:      linux/amd64

Podman package info (rpm -q podman)

podman-4.2.1-2.fc36.x86_64

Info about your OS

Fedora Silverblue 36

Additional context

This is a screenshot which represent the issue better:

image

If I try to close the terminal emulator, it'll prompt the following:

image

If I press "Close Terminal", sh, toolbox and podman (which runs exec command) will be terminated because they're child process of the vte session.

However, notice the conmon and its child process sleep aren't part of gnome-terminal-server. When sh is terminated, podman (exec command) will be terminated but the corresponding conmon process will be kept intact. As a result, sleep 30 isn't terminated properly.

And sleep 30 is only used for demonstration. In reality one could run something resource intensive, and then close the terminal emulator not knowing they're lingering in the background.

Source: #1204

Metadata

Assignees

No one assigned

    Labels

    1. BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions