-
Notifications
You must be signed in to change notification settings - Fork 429
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
[Error] Shell with children does not exit with the terminal #786
Comments
Seems to be same issue as containers/toolbox#1204 |
Possibly connected to #613 As seen in the issue you also linked there isn't much we can do distrobox side |
It does not seem like podman will do anything to fix this so i was thinking of ways to solve this outside it, here are some ideas i had
2nd MethodProof of concept, works fine and i cannot replicate the problem mentioned above when using it Getting parent PID which in this case is conmon, then replace process with whatever is ran in this case zsh shell Using PID of the script as name for the PID file as it should always be unique (I intentionally left the debugging statements) #!/usr/bin/env sh
#
# distrobox-enter-wrapper - wrapper around distrobox-enter
if [ -z "$1" ]; then
echo "Please provide container name"
exit 1
fi
PIDFILE_DIR="$HOME/.local/state/distrobox"
PIDFILE="$PIDFILE_DIR/$$"
mkdir -p "$PIDFILE_DIR"
touch "$PIDFILE"
nohup sh <<EOF &
echo "background process monitoring started, waiting for $$"
# wait for the main script to end
while ps -p $$ >/dev/null; do
sleep 1s
done
PID="\$(cat "$PIDFILE")"
rm -f "$PIDFILE"
if ! ps -p "\$PID" >/dev/null; then
echo "conmon is already dead"
exit 0
fi
echo "process ended but conmon is alive, killing conmon (\$PID)"
kill -1 "\$PID"
echo "done, quitting"
exit 0
EOF
distrobox enter "$1" -- sh -c "echo \$PPID > $PIDFILE; exec ${2:-$SHELL}"
... I'd love some feedback |
Closing this in favor or #966 |
Describe the bug
The shell does not always quit and neither do its children
To Reproduce
Steps to reproduce the behavior
distrobox enter
sleep 60s
Expected behavior
The shell should have been terminated with the terminal window, and all their children cleared up
Actual behaviour
Running
ps -ef | grep -E 'bash|zsh|fish'
returnsAnd keeps increasing each time, and wont ever quit because they probably have been stalled and you cannot continue it like a tmux/screen session
Logs
Run the commands with
--verbose
and post the log here as a file uploadAttach also the output of
podman logs
ordocker logs
, possibly with--latest
flagBelow is output from
podman logs --latest
Additional context
Distribution: Fedora Kinoite 38.20230603.0
Tested using following terminal emulators Konsole, WezTerm
Tested using both bash and zsh
Tested using both login and non login shell
Same happens with
toolbox enter
The text was updated successfully, but these errors were encountered: