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

Detached Processes launched by sunshine end up as zombies on linux after closing them #3378

Closed
2 tasks done
MNarath1 opened this issue Nov 7, 2024 · 0 comments · Fixed by #3379
Closed
2 tasks done

Comments

@MNarath1
Copy link

MNarath1 commented Nov 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

When you start applications on a linux host with sunshine trough detached command with setsid like setsid steam or setsid gamescope -e -- steam steam://open/bigpicture it will not be truely detached from the parent process meaning when you try to stop the application launched by sunshine it will leave a zombie process that will keep using up pid's until you stop sunshine or restart your pc.

Expected Behavior

Launching an application detached from the parent process should actually detach it and not keep it in a semi attached state were it then just doesn't get a response by the parent process when it tries to die (that results in a zombie process).

Additional Context

Either something has to change how detached commands work or the parent has to actually allow the child process to die instead of leaving it in a limbo.

Host Operating System

Linux

Operating System Version

Fedora 41 KDE

Architecture

amd64/x86_64

Sunshine commit or version

v2024.1107.45727

Package

Linux - Fedora Copr

GPU Type

Nvidia

GPU Model

Nividia RTX2070 Super

GPU Driver/Mesa Version

565.57.01

Capture Method

None

Config

No response

Apps

{
    "env": {
        "PATH": "$(PATH):$(HOME)\/.local\/bin"
    },
    "apps": [
        {
            "name": "Desktop",
            "image-path": "desktop.png",
            "exclude-global-prep-cmd": "false",
            "auto-detach": "true",
            "wait-all": "true",
            "exit-timeout": "5"
        },
        {
            "name": "Low Res Desktop",
            "image-path": "desktop.png",
            "prep-cmd": [
                {
                    "do": "xrandr --output HDMI-1 --mode 1920x1080",
                    "undo": "xrandr --output HDMI-1 --mode 1920x1200"
                }
            ]
        },
        {
            "name": "MoonDeckStream",
            "output": "",
            "cmd": "",
            "exclude-global-prep-cmd": "false",
            "elevated": "false",
            "auto-detach": "true",
            "wait-all": "true",
            "exit-timeout": "5",
            "detached": [
                "\/home\/user\/.Appimages\/moondeckbuddy.appimage --exec MoonDeckStream"
            ],
            "image-path": "",
            "prep-cmd": [
                {
                    "do": "sh -c \"kscreen-doctor output.HDMI-A-1.mode.${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}\"",
                    "undo": "kscreen-doctor output.HDMI-A-1.mode.1920x1080@60"
                }
            ]
        },
        {
            "name": "Steam Big Picture",
            "detached": [
                "setsid gamescope -e -- steam steam:\/\/open\/bigpicture"
            ],
            "image-path": "steam.png",
            "exclude-global-prep-cmd": "",
            "auto-detach": "true",
            "wait-all": "true",
            "exit-timeout": "5"
        }
    ]
}

Relevant log output

Nothing like that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant