Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forked app not considered when running toolbox run #1038

Closed
Meister1593 opened this issue Apr 9, 2022 · 5 comments
Closed

Forked app not considered when running toolbox run #1038

Meister1593 opened this issue Apr 9, 2022 · 5 comments
Labels
1. Feature request A request for a new feature

Comments

@Meister1593
Copy link

Meister1593 commented Apr 9, 2022

Is your feature request related to a problem? Please describe.
Basically, when i try to run forking app, after it forks - toolbox considers that container needs to be removed and does that, even if forked app was still working on the background.

Describe the solution you'd like
Forking app should be considered when running programs using toolbox run and it should not destroy container before forked app closes

Additional context
Initially, i wanted to run Webex app in toolbox (f33, because of libsecret library compatibilities), so far it worked good when i used toolbox enter, but when i started integrating it with desktop using toolbox run, i quickly realised that it is being destroyed right after it starts.
This C code sample should provide reliable example of toolbox killing container before forking app closes.

Steps:

  1. Create file testfork.c:
#include <stdio.h>
#include <unistd.h>

int main(void){
        int pid;
        printf("firstapp\n");
        pid = fork();
        if (pid){
                printf("parentapp\n");
        }
        else {
                sleep(2);
                printf("forkapp\n");
        }
}
  1. Compile using gcc:gcc testfork.c

  2. Run using toolbox: toolbox run ./a.out

  3. Expect output like so (with last line appearing after 2 seconds of delay):

firstapp
parentapp
forkapp

But it will show (flawed) output like this:

firstapp
parentapp
Debug log of that launch
level=debug msg="Running as real user ID 1000"
level=debug msg="Resolved absolute path to the executable as /usr/bin/toolbox"
level=debug msg="Running on a cgroups v2 host"
level=debug msg="Checking if /etc/subgid and /etc/subuid have entries for user plyshka"
level=debug msg="Validating sub-ID file /etc/subuid"
level=debug msg="Validating sub-ID file /etc/subgid"
level=debug msg="TOOLBOX_PATH is /usr/bin/toolbox"
level=debug msg="Migrating to newer Podman"
level=debug msg="Toolbox config directory is /home/plyshka/.config/toolbox"
time="2022-04-10T00:58:23+04:00" level=info msg="podman filtering at log level debug"
time="2022-04-10T00:58:23+04:00" level=debug msg="Called version.PersistentPreRunE(podman --log-level debug version --format json)"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Merged system config \"/usr/share/containers/containers.conf\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using conmon: \"/usr/bin/conmon\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Initializing boltdb state at /var/home/plyshka/.local/share/containers/storage/libpod/bolt_state.db"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding graph root \"/var/home/plyshka/.local/share/containers/storage\" with \"/home/plyshka/.local/share/containers/storage\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding static dir \"/var/home/plyshka/.local/share/containers/storage/libpod\" with \"/home/plyshka/.local/share/containers/storage/libpod\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding volume path \"/var/home/plyshka/.local/share/containers/storage/volumes\" with \"/home/plyshka/.local/share/containers/storage/volumes\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using graph driver overlay"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using graph root /home/plyshka/.local/share/containers/storage"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using run root /run/user/1000/containers"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using static dir /home/plyshka/.local/share/containers/storage/libpod"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using tmp dir /run/user/1000/libpod/tmp"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using volume path /home/plyshka/.local/share/containers/storage/volumes"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Set libpod namespace to \"\""
time="2022-04-10T00:58:23+04:00" level=debug msg="[graphdriver] trying provided driver \"overlay\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that metacopy is not being used"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that native-diff is usable"
time="2022-04-10T00:58:23+04:00" level=debug msg="backingFs=btrfs, projectQuotaSupported=false, useNativeDiff=true, usingMetacopy=false"
time="2022-04-10T00:58:23+04:00" level=debug msg="Initializing event backend journald"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime runc initialization failed: no valid executable found for OCI runtime runc: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using OCI runtime \"/usr/bin/crun\""
time="2022-04-10T00:58:23+04:00" level=info msg="Found CNI network podman (type=bridge) at /var/home/plyshka/.config/cni/net.d/87-podman.conflist"
time="2022-04-10T00:58:23+04:00" level=debug msg="Default CNI network name podman is unchangeable"
time="2022-04-10T00:58:23+04:00" level=info msg="Setting parallel job count to 13"
time="2022-04-10T00:58:23+04:00" level=debug msg="Called version.PersistentPostRunE(podman --log-level debug version --format json)"
level=debug msg="Current Podman version is 3.4.4"
level=debug msg="Creating runtime directory /run/user/1000/toolbox"
level=debug msg="Old Podman version is 3.4.4"
level=debug msg="Migration not needed: Podman version 3.4.4 is unchanged"
level=debug msg="Setting up configuration"
level=debug msg="Setting up configuration: file /home/plyshka/.config/containers/toolbox.conf not found"
level=debug msg="Resolving image name"
level=debug msg="Distribution (CLI): ''"
level=debug msg="Image (CLI): ''"
level=debug msg="Release (CLI): ''"
level=debug msg="Resolved image name"
level=debug msg="Image: 'fedora-toolbox:35'"
level=debug msg="Release: '35'"
level=debug msg="Resolving container name"
level=debug msg="Container: ''"
level=debug msg="Image: 'fedora-toolbox:35'"
level=debug msg="Release: '35'"
level=debug msg="Resolved container name"
level=debug msg="Container: 'fedora-toolbox-35'"
level=debug msg="Resolving image name"
level=debug msg="Distribution (CLI): ''"
level=debug msg="Image (CLI): ''"
level=debug msg="Release (CLI): ''"
level=debug msg="Resolved image name"
level=debug msg="Image: 'fedora-toolbox:35'"
level=debug msg="Release: '35'"
level=debug msg="Resolving container name"
level=debug msg="Container: ''"
level=debug msg="Image: 'fedora-toolbox:35'"
level=debug msg="Release: '35'"
level=debug msg="Resolved container name"
level=debug msg="Container: 'fedora-toolbox-35'"
level=debug msg="Checking if container fedora-toolbox-35 exists"
time="2022-04-10T00:58:23+04:00" level=info msg="podman filtering at log level debug"
time="2022-04-10T00:58:23+04:00" level=debug msg="Called exists.PersistentPreRunE(podman --log-level debug container exists fedora-toolbox-35)"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Merged system config \"/usr/share/containers/containers.conf\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using conmon: \"/usr/bin/conmon\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Initializing boltdb state at /var/home/plyshka/.local/share/containers/storage/libpod/bolt_state.db"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding graph root \"/var/home/plyshka/.local/share/containers/storage\" with \"/home/plyshka/.local/share/containers/storage\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding static dir \"/var/home/plyshka/.local/share/containers/storage/libpod\" with \"/home/plyshka/.local/share/containers/storage/libpod\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding volume path \"/var/home/plyshka/.local/share/containers/storage/volumes\" with \"/home/plyshka/.local/share/containers/storage/volumes\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using graph driver overlay"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using graph root /home/plyshka/.local/share/containers/storage"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using run root /run/user/1000/containers"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using static dir /home/plyshka/.local/share/containers/storage/libpod"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using tmp dir /run/user/1000/libpod/tmp"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using volume path /home/plyshka/.local/share/containers/storage/volumes"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Set libpod namespace to \"\""
time="2022-04-10T00:58:23+04:00" level=debug msg="[graphdriver] trying provided driver \"overlay\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that metacopy is not being used"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that native-diff is usable"
time="2022-04-10T00:58:23+04:00" level=debug msg="backingFs=btrfs, projectQuotaSupported=false, useNativeDiff=true, usingMetacopy=false"
time="2022-04-10T00:58:23+04:00" level=debug msg="Initializing event backend journald"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime runc initialization failed: no valid executable found for OCI runtime runc: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using OCI runtime \"/usr/bin/crun\""
time="2022-04-10T00:58:23+04:00" level=info msg="Found CNI network podman (type=bridge) at /var/home/plyshka/.config/cni/net.d/87-podman.conflist"
time="2022-04-10T00:58:23+04:00" level=debug msg="Default CNI network name podman is unchangeable"
time="2022-04-10T00:58:23+04:00" level=info msg="Setting parallel job count to 13"
time="2022-04-10T00:58:23+04:00" level=debug msg="Called exists.PersistentPostRunE(podman --log-level debug container exists fedora-toolbox-35)"
level=debug msg="Inspecting mounts of container fedora-toolbox-35"
time="2022-04-10T00:58:23+04:00" level=info msg="podman filtering at log level debug"
time="2022-04-10T00:58:23+04:00" level=debug msg="Called inspect.PersistentPreRunE(podman --log-level debug inspect --format json --type container fedora-toolbox-35)"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Merged system config \"/usr/share/containers/containers.conf\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using conmon: \"/usr/bin/conmon\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Initializing boltdb state at /var/home/plyshka/.local/share/containers/storage/libpod/bolt_state.db"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding graph root \"/var/home/plyshka/.local/share/containers/storage\" with \"/home/plyshka/.local/share/containers/storage\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding static dir \"/var/home/plyshka/.local/share/containers/storage/libpod\" with \"/home/plyshka/.local/share/containers/storage/libpod\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Overriding volume path \"/var/home/plyshka/.local/share/containers/storage/volumes\" with \"/home/plyshka/.local/share/containers/storage/volumes\" from database"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using graph driver overlay"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using graph root /home/plyshka/.local/share/containers/storage"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using run root /run/user/1000/containers"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using static dir /home/plyshka/.local/share/containers/storage/libpod"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using tmp dir /run/user/1000/libpod/tmp"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using volume path /home/plyshka/.local/share/containers/storage/volumes"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Set libpod namespace to \"\""
time="2022-04-10T00:58:23+04:00" level=debug msg="[graphdriver] trying provided driver \"overlay\""
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that metacopy is not being used"
time="2022-04-10T00:58:23+04:00" level=debug msg="Cached value indicated that native-diff is usable"
time="2022-04-10T00:58:23+04:00" level=debug msg="backingFs=btrfs, projectQuotaSupported=false, useNativeDiff=true, usingMetacopy=false"
time="2022-04-10T00:58:23+04:00" level=debug msg="Initializing event backend journald"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime runc initialization failed: no valid executable found for OCI runtime runc: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument"
time="2022-04-10T00:58:23+04:00" level=debug msg="Using OCI runtime \"/usr/bin/crun\""
time="2022-04-10T00:58:23+04:00" level=info msg="Found CNI network podman (type=bridge) at /var/home/plyshka/.config/cni/net.d/87-podman.conflist"
time="2022-04-10T00:58:23+04:00" level=debug msg="Default CNI network name podman is unchangeable"
time="2022-04-10T00:58:23+04:00" level=info msg="Setting parallel job count to 13"
time="2022-04-10T00:58:23+04:00" level=debug msg="Error parsing cgroup: expected 3 fields but got 1: /proc/7072/cgroup"
time="2022-04-10T00:58:23+04:00" level=debug msg="Called inspect.PersistentPostRunE(podman --log-level debug inspect --format json --type container fedora-toolbox-35)"
level=debug msg="Starting container fedora-toolbox-35"
level=debug msg="Inspecting entry point of container fedora-toolbox-35"
time="2022-04-10T00:58:24+04:00" level=info msg="podman filtering at log level debug"
time="2022-04-10T00:58:24+04:00" level=debug msg="Called inspect.PersistentPreRunE(podman --log-level debug inspect --format json --type container fedora-toolbox-35)"
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:24+04:00" level=debug msg="Merged system config \"/usr/share/containers/containers.conf\""
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using conmon: \"/usr/bin/conmon\""
time="2022-04-10T00:58:24+04:00" level=debug msg="Initializing boltdb state at /var/home/plyshka/.local/share/containers/storage/libpod/bolt_state.db"
time="2022-04-10T00:58:24+04:00" level=debug msg="Overriding graph root \"/var/home/plyshka/.local/share/containers/storage\" with \"/home/plyshka/.local/share/containers/storage\" from database"
time="2022-04-10T00:58:24+04:00" level=debug msg="Overriding static dir \"/var/home/plyshka/.local/share/containers/storage/libpod\" with \"/home/plyshka/.local/share/containers/storage/libpod\" from database"
time="2022-04-10T00:58:24+04:00" level=debug msg="Overriding volume path \"/var/home/plyshka/.local/share/containers/storage/volumes\" with \"/home/plyshka/.local/share/containers/storage/volumes\" from database"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using graph driver overlay"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using graph root /home/plyshka/.local/share/containers/storage"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using run root /run/user/1000/containers"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using static dir /home/plyshka/.local/share/containers/storage/libpod"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using tmp dir /run/user/1000/libpod/tmp"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using volume path /home/plyshka/.local/share/containers/storage/volumes"
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:24+04:00" level=debug msg="Set libpod namespace to \"\""
time="2022-04-10T00:58:24+04:00" level=debug msg="[graphdriver] trying provided driver \"overlay\""
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that metacopy is not being used"
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that native-diff is usable"
time="2022-04-10T00:58:24+04:00" level=debug msg="backingFs=btrfs, projectQuotaSupported=false, useNativeDiff=true, usingMetacopy=false"
time="2022-04-10T00:58:24+04:00" level=debug msg="Initializing event backend journald"
time="2022-04-10T00:58:24+04:00" level=debug msg="configured OCI runtime runc initialization failed: no valid executable found for OCI runtime runc: invalid argument"
time="2022-04-10T00:58:24+04:00" level=debug msg="configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument"
time="2022-04-10T00:58:24+04:00" level=debug msg="configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using OCI runtime \"/usr/bin/crun\""
time="2022-04-10T00:58:24+04:00" level=info msg="Found CNI network podman (type=bridge) at /var/home/plyshka/.config/cni/net.d/87-podman.conflist"
time="2022-04-10T00:58:24+04:00" level=debug msg="Default CNI network name podman is unchangeable"
time="2022-04-10T00:58:24+04:00" level=info msg="Setting parallel job count to 13"
time="2022-04-10T00:58:24+04:00" level=debug msg="Error parsing cgroup: expected 3 fields but got 1: /proc/7072/cgroup"
time="2022-04-10T00:58:24+04:00" level=debug msg="Called inspect.PersistentPostRunE(podman --log-level debug inspect --format json --type container fedora-toolbox-35)"
level=debug msg="Entry point PID is a float64"
level=debug msg="Entry point of container fedora-toolbox-35 is toolbox (PID=7072)"
level=debug msg="Waiting for container fedora-toolbox-35 to finish initializing"
level=debug msg="Creating runtime directory /run/user/1000/toolbox"
level=debug msg="Checking if initialization stamp /run/user/1000/toolbox/container-initialized-7072 exists"
level=debug msg="Container fedora-toolbox-35 is initialized"
level=debug msg="Checking if 'podman exec' supports disabling the detach keys"
level=debug msg="'podman exec' supports disabling the detach keys"
level=debug msg="Creating list of environment variables to forward"
level=debug msg="COLORTERM=truecolor"
level=debug msg="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
level=debug msg="DBUS_SYSTEM_BUS_ADDRESS is unset"
level=debug msg="DESKTOP_SESSION=/usr/share/wayland-sessions/plasma"
level=debug msg="DISPLAY=:1"
level=debug msg="LANG=en_GB.UTF-8"
level=debug msg="SHELL=/bin/bash"
level=debug msg="SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket"
level=debug msg="TERM=xterm-256color"
level=debug msg="TOOLBOX_PATH=/usr/bin/toolbox"
level=debug msg="USER=plyshka"
level=debug msg="VTE_VERSION is unset"
level=debug msg="WAYLAND_DISPLAY=wayland-0"
level=debug msg="XAUTHORITY=/run/user/1000/xauth_mruNpU"
level=debug msg="XDG_CURRENT_DESKTOP=KDE"
level=debug msg="XDG_DATA_DIRS=/home/plyshka/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share"
level=debug msg="XDG_MENU_PREFIX=kf5-"
level=debug msg="XDG_RUNTIME_DIR=/run/user/1000"
level=debug msg="XDG_SEAT=seat0"
level=debug msg="XDG_SESSION_DESKTOP=KDE"
level=debug msg="XDG_SESSION_ID=2"
level=debug msg="XDG_SESSION_TYPE=wayland"
level=debug msg="XDG_VTNR=1"
level=debug msg="Running in container fedora-toolbox-35:"
level=debug msg=podman
level=debug msg=--log-level
level=debug msg=debug
level=debug msg=exec
level=debug msg=--detach-keys
level=debug
level=debug msg=--interactive
level=debug msg=--tty
level=debug msg=--user
level=debug msg=plyshka
level=debug msg=--workdir
level=debug msg=/var/home/plyshka
level=debug msg="--env=COLORTERM=truecolor"
level=debug msg="--env=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
level=debug msg="--env=DESKTOP_SESSION=/usr/share/wayland-sessions/plasma"
level=debug msg="--env=DISPLAY=:1"
level=debug msg="--env=LANG=en_GB.UTF-8"
level=debug msg="--env=SHELL=/bin/bash"
level=debug msg="--env=SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket"
level=debug msg="--env=TERM=xterm-256color"
level=debug msg="--env=TOOLBOX_PATH=/usr/bin/toolbox"
level=debug msg="--env=USER=plyshka"
level=debug msg="--env=WAYLAND_DISPLAY=wayland-0"
level=debug msg="--env=XAUTHORITY=/run/user/1000/xauth_mruNpU"
level=debug msg="--env=XDG_CURRENT_DESKTOP=KDE"
level=debug msg="--env=XDG_DATA_DIRS=/home/plyshka/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share"
level=debug msg="--env=XDG_MENU_PREFIX=kf5-"
level=debug msg="--env=XDG_RUNTIME_DIR=/run/user/1000"
level=debug msg="--env=XDG_SEAT=seat0"
level=debug msg="--env=XDG_SESSION_DESKTOP=KDE"
level=debug msg="--env=XDG_SESSION_ID=2"
level=debug msg="--env=XDG_SESSION_TYPE=wayland"
level=debug msg="--env=XDG_VTNR=1"
level=debug msg=fedora-toolbox-35
level=debug msg=capsh
level=debug msg="--caps="
level=debug msg=--
level=debug msg=-c
level=debug msg="exec \"$@\""
level=debug msg=/bin/sh
level=debug msg=./a.out
time="2022-04-10T00:58:24+04:00" level=info msg="podman filtering at log level debug"
time="2022-04-10T00:58:24+04:00" level=debug msg="Called exec.PersistentPreRunE(podman --log-level debug exec --detach-keys  --interactive --tty --user plyshka --workdir /var/home/plyshka --env=COLORTERM=truecolor --env=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus --env=DESKTOP_SESSION=/usr/share/wayland-sessions/plasma --env=DISPLAY=:1 --env=LANG=en_GB.UTF-8 --env=SHELL=/bin/bash --env=SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket --env=TERM=xterm-256color --env=TOOLBOX_PATH=/usr/bin/toolbox --env=USER=plyshka --env=WAYLAND_DISPLAY=wayland-0 --env=XAUTHORITY=/run/user/1000/xauth_mruNpU --env=XDG_CURRENT_DESKTOP=KDE --env=XDG_DATA_DIRS=/home/plyshka/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share --env=XDG_MENU_PREFIX=kf5- --env=XDG_RUNTIME_DIR=/run/user/1000 --env=XDG_SEAT=seat0 --env=XDG_SESSION_DESKTOP=KDE --env=XDG_SESSION_ID=2 --env=XDG_SESSION_TYPE=wayland --env=XDG_VTNR=1 fedora-toolbox-35 capsh --caps= -- -c exec \"$@\" /bin/sh ./a.out)"
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:24+04:00" level=debug msg="Merged system config \"/usr/share/containers/containers.conf\""
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using conmon: \"/usr/bin/conmon\""
time="2022-04-10T00:58:24+04:00" level=debug msg="Initializing boltdb state at /var/home/plyshka/.local/share/containers/storage/libpod/bolt_state.db"
time="2022-04-10T00:58:24+04:00" level=debug msg="Overriding graph root \"/var/home/plyshka/.local/share/containers/storage\" with \"/home/plyshka/.local/share/containers/storage\" from database"
time="2022-04-10T00:58:24+04:00" level=debug msg="Overriding static dir \"/var/home/plyshka/.local/share/containers/storage/libpod\" with \"/home/plyshka/.local/share/containers/storage/libpod\" from database"
time="2022-04-10T00:58:24+04:00" level=debug msg="Overriding volume path \"/var/home/plyshka/.local/share/containers/storage/volumes\" with \"/home/plyshka/.local/share/containers/storage/volumes\" from database"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using graph driver overlay"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using graph root /home/plyshka/.local/share/containers/storage"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using run root /run/user/1000/containers"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using static dir /home/plyshka/.local/share/containers/storage/libpod"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using tmp dir /run/user/1000/libpod/tmp"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using volume path /home/plyshka/.local/share/containers/storage/volumes"
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:24+04:00" level=debug msg="Set libpod namespace to \"\""
time="2022-04-10T00:58:24+04:00" level=debug msg="[graphdriver] trying provided driver \"overlay\""
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that overlay is supported"
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that metacopy is not being used"
time="2022-04-10T00:58:24+04:00" level=debug msg="Cached value indicated that native-diff is usable"
time="2022-04-10T00:58:24+04:00" level=debug msg="backingFs=btrfs, projectQuotaSupported=false, useNativeDiff=true, usingMetacopy=false"
time="2022-04-10T00:58:24+04:00" level=debug msg="Initializing event backend journald"
time="2022-04-10T00:58:24+04:00" level=debug msg="configured OCI runtime runc initialization failed: no valid executable found for OCI runtime runc: invalid argument"
time="2022-04-10T00:58:24+04:00" level=debug msg="configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument"
time="2022-04-10T00:58:24+04:00" level=debug msg="configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument"
time="2022-04-10T00:58:24+04:00" level=debug msg="Using OCI runtime \"/usr/bin/crun\""
time="2022-04-10T00:58:24+04:00" level=info msg="Found CNI network podman (type=bridge) at /var/home/plyshka/.config/cni/net.d/87-podman.conflist"
time="2022-04-10T00:58:24+04:00" level=debug msg="Default CNI network name podman is unchangeable"
time="2022-04-10T00:58:24+04:00" level=info msg="Setting parallel job count to 13"
time="2022-04-10T00:58:24+04:00" level=debug msg="Handling terminal attach"
time="2022-04-10T00:58:24+04:00" level=info msg="Created exec session 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491 in container b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7"

time="2022-04-10T00:58:24+04:00" level=debug msg="Sending resize events to exec session 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491"

time="2022-04-10T00:58:24+04:00" level=info msg="Going to start container b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7 exec session 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491 and attach to it"

time="2022-04-10T00:58:24+04:00" level=debug msg="/usr/bin/conmon messages will be logged to syslog"

time="2022-04-10T00:58:24+04:00" level=debug msg="running conmon: /usr/bin/conmon" args="[--api-version 1 -c b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7 -u 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491 -r /usr/bin/crun -b /home/plyshka/.local/share/containers/storage/overlay-containers/b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7/userdata/7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491 -p /home/plyshka/.local/share/containers/storage/overlay-containers/b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7/userdata/7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491/exec_pid -n fedora-toolbox-35 --exit-dir /home/plyshka/.local/share/containers/storage/overlay-containers/b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7/userdata/7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491/exit --full-attach -s -l none --log-level debug --syslog -t -i -e --exec-attach --exec-process-spec /home/plyshka/.local/share/containers/storage/overlay-containers/b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7/userdata/7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491/exec-process-973250684 --exit-command /usr/bin/podman --exit-command-arg --root --exit-command-arg /home/plyshka/.local/share/containers/storage --exit-command-arg --runroot --exit-command-arg /run/user/1000/containers --exit-command-arg --log-level --exit-command-arg debug --exit-command-arg --cgroup-manager --exit-command-arg systemd --exit-command-arg --tmpdir --exit-command-arg /run/user/1000/libpod/tmp --exit-command-arg --runtime --exit-command-arg crun --exit-command-arg --storage-driver --exit-command-arg overlay --exit-command-arg --events-backend --exit-command-arg journald --exit-command-arg container --exit-command-arg cleanup --exit-command-arg --exec --exit-command-arg 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491 --exit-command-arg b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7]"

time="2022-04-10T00:58:24+04:00" level=debug msg="Attaching to container b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7 exec session 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491"

time="2022-04-10T00:58:24+04:00" level=debug msg="Received: 0"

time="2022-04-10T00:58:24+04:00" level=debug msg="Received: 23261"

time="2022-04-10T00:58:24+04:00" level=debug msg="Successfully started exec session 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491 in container b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7"

[conmon:d]: exec with attach is waiting for start message from parent
[conmon:d]: exec with attach got start message from parent
firstapp
parentapp
time="2022-04-10T00:58:24+04:00" level=debug msg="Container b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7 exec session 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491 completed with exit code 0"

time="2022-04-10T00:58:24+04:00" level=info msg="Removing container b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7 exec session 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491"

time="2022-04-10T00:58:24+04:00" level=debug msg="Successfully removed container b2456cf2eccc69c352140bdd0a203f7746662afc23a8174da7f4c246a94d4bd7 exec session 7e10ae40fa859a65ec767efb1618bd5b1bc934fba238deb49a678d89a91df491"

time="2022-04-10T00:58:24+04:00" level=debug msg="Called exec.PersistentPostRunE(podman --log-level debug exec --detach-keys  --interactive --tty --user plyshka --workdir /var/home/plyshka --env=COLORTERM=truecolor --env=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus --env=DESKTOP_SESSION=/usr/share/wayland-sessions/plasma --env=DISPLAY=:1 --env=LANG=en_GB.UTF-8 --env=SHELL=/bin/bash --env=SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket --env=TERM=xterm-256color --env=TOOLBOX_PATH=/usr/bin/toolbox --env=USER=plyshka --env=WAYLAND_DISPLAY=wayland-0 --env=XAUTHORITY=/run/user/1000/xauth_mruNpU --env=XDG_CURRENT_DESKTOP=KDE --env=XDG_DATA_DIRS=/home/plyshka/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share --env=XDG_MENU_PREFIX=kf5- --env=XDG_RUNTIME_DIR=/run/user/1000 --env=XDG_SEAT=seat0 --env=XDG_SESSION_DESKTOP=KDE --env=XDG_SESSION_ID=2 --env=XDG_SESSION_TYPE=wayland --env=XDG_VTNR=1 fedora-toolbox-35 capsh --caps= -- -c exec \"$@\" /bin/sh ./a.out)"
@Meister1593 Meister1593 added the 1. Feature request A request for a new feature label Apr 9, 2022
@Meister1593
Copy link
Author

Meister1593 commented Apr 9, 2022

Distrobox has exactly the same behaviour with distrobox-enter -- ./forkingprogram by the way, i hope this behaviour is not intentional between these two projects

@Meister1593
Copy link
Author

Meister1593 commented Apr 10, 2022

According to flatpak webex issue, Webex even uses combination of fork + execve calls to launch main app. This issue might be helpful to develop this feature into toolbox/conmon (not sure which components needs to be echanced)

@akdev1l
Copy link

akdev1l commented Aug 17, 2022

doesn't seem like there's much to do on this issue - toolbox run is just podman exec -it with some makeup.

The behaviour described seems to be working as expected - podman grabs a handle of the parent process not the child.

You should be able to just wrap it in a script: toolbox run $toolbox bash -c 'webex && wait' - it should work that way with both distrobox and toolbox

@debarshiray
Copy link
Member

As @akdev1l mentioned ...

I am not sure if Toolbx can really do anything here. If you are working on a launcher for an application like that (uses fork and execve to launch the main process without wait), then it's the launcher that needs to handle that somehow.

It's difficult for Toolbx to know what the intended behaviour is, because it depends on the process. eg., the current behaviour you are seeing could be considered OK for a daemon.

@debarshiray
Copy link
Member

Closing!

Thanks for your interest in Toolbx, and trying to make Webex work (especially with Flatpak)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Feature request A request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants