-
Notifications
You must be signed in to change notification settings - Fork 90
feat(steam): allow proper exit through power menu #240
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
base: master
Are you sure you want to change the base?
feat(steam): allow proper exit through power menu #240
Conversation
163d8e6
to
b5bce11
Compare
steamos-dbus-watchdog.sh listens for dbus messages which are sent by Steam Big Picture's power menu and then sends a shutdown signal to steam using the -shutdown arg. This allows stopping using the power menu which is useful when using steam with -steamos/-steamdeck args.
b5bce11
to
def533a
Compare
This may seem like a stupid question. But is this change to allow shutdown through say the steam container? If so is that just shutting the container down or the host itself? |
This script only stops steam by executing Giving privilege to containers isn't recommended, but if you actually want your host to shut down when your Steam container sends a Shutdown signal, you probably have to give the Steam container privilege and access to the system's dbus. I have not tested the config below so I cannot guarantee that this will work, nor will I test this as I don't wanna shut down my server lol. But it "should" be fairly safe to run, the worst thing that will happen is that it will either not work at all or your host might need a reboot. [[apps]]
title = "Steam"
icon_png_path = "https://games-on-whales.github.io/wildlife/apps/steam/assets/icon.png"
[apps.runner]
type = "docker"
name = "WolfSteam"
image = "ghcr.io/games-on-whales/steam:edge"
mounts = [
"/sys/fs/cgroup:/sys/fs/cgroup",
"/var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket",
"/run/systemd/system:/run/systemd/system",
"/bin/systemctl:/bin/systemctl"
]
env = [
"RUN_SWAY=true",
"GOW_REQUIRED_DEVICES=/dev/input/* /dev/dri/* /dev/nvidia*",
]
devices = []
ports = []
base_create_json = """
{
"HostConfig": {
"IpcMode": "host",
"CapAdd": ["SYS_ADMIN", "SYS_NICE", "SYS_PTRACE", "NET_RAW", "MKNOD", "NET_ADMIN"],
"SecurityOpt": ["seccomp=unconfined", "apparmor=unconfined"],
"Ulimits": [{"Name":"nofile", "Hard":10240, "Soft":10240}],
"Privileged": true,
"DeviceCgroupRules": ["c 13:* rmw", "c 244:* rmw"]
}
}
\
""" I got the mounts from a Stackoverflow post, there is a chance you have to change them if you do not run a Debian based OS. |
Nah sorry i was asking cause the initial comment implied this was to add a capability to do that.
but wasn’t sure so figured I’d ask. Definitely would want a container to shut a host down
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: shawly ***@***.***>
Sent: Monday, June 9, 2025 6:24:26 PM
To: games-on-whales/gow ***@***.***>
Cc: salty2011 ***@***.***>; Comment ***@***.***>
Subject: Re: [games-on-whales/gow] feat(steam): allow shutdown through power menu (PR #240)
[https://avatars.githubusercontent.com/u/6448794?s=20&v=4]shawly left a comment (games-on-whales/gow#240)<#240 (comment)>
This may seem like a stupid question.
But is this change to allow shutdown through say the steam container?
If so is that just shutting the container down or the host itself?
This script only stops steam by executing steam -shutdown. As long as a container doesn't share the hosts dbus and has privilege it is not able to shut down the host.
Giving privilege to containers isn't recommended, but if you actually want your host to shut down when your Steam container sends a Shutdown signal, you probably have to give the Steam container privilege and access to the system's dbus.
I have not tested this so I cannot guarantee that this will work, nor will I test this as I don't wanna shut down my server lol. But it "should" be fairly safe to run, the worst thing that will happen is that it will either not work at all or your host might need a reboot.
[[apps]]
title = "Steam"
icon_png_path = "https://games-on-whales.github.io/wildlife/apps/steam/assets/icon.png"
[apps.runner]
type = "docker"
name = "WolfSteam"
image = "ghcr.io/games-on-whales/steam:edge"
mounts = [
"/sys/fs/cgroup:/sys/fs/cgroup",
"/var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket",
"/run/systemd/system:/run/systemd/system",
"/bin/systemctl:/bin/systemctl"
]
env = [
"RUN_SWAY=true",
"GOW_REQUIRED_DEVICES=/dev/input/* /dev/dri/* /dev/nvidia*",
]
devices = []
ports = []
base_create_json = """
{
"HostConfig": {
"IpcMode": "host",
"CapAdd": ["SYS_ADMIN", "SYS_NICE", "SYS_PTRACE", "NET_RAW", "MKNOD", "NET_ADMIN"],
"SecurityOpt": ["seccomp=unconfined", "apparmor=unconfined"],
"Ulimits": [{"Name":"nofile", "Hard":10240, "Soft":10240}],
"Privileged": true,
"DeviceCgroupRules": ["c 13:* rmw", "c 244:* rmw"]
}
}
\
"""
—
Reply to this email directly, view it on GitHub<#240 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACPIAFE44UAQX6GQF72G4F33CVADVAVCNFSM6AAAAAB63NYKYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNJVGA2TGOJWGA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
You're right, the wording was kinda misleading! |
steamos-dbus-watchdog.sh listens for dbus messages which are sent by Steam Big Picture's power menu and then sends a shutdown signal to steam using the -shutdown arg. This allows stopping using the power menu which is useful when using steam with -steamos/-steamdeck args.
We could also integrate something similar like to this script into the base-app image that SIGTERMs gamescope and sway when we detect a Shutdown signal on the DBus, this would add compatibility for other launchers that have a power menu, like Kodi for example and other frontends. At least if these frontends actually are using the D-Bus to communicate, which would require some testing.