Skip to content

frontend: Restore --disable-shutdown-check - #810

Merged
zackees merged 2 commits into
obs-rust:masterfrom
vpacher:fix/disable-shutdown-check
Oct 15, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
vpacher:fix/disable-shutdown-check

Conversation

@vpacher

@vpacher vpacher commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Fixes #809

What and why

OBS 32.0 removed --disable-shutdown-check (upstream de997b1; upstream report obsproject/obs-studio#12650, closed as not planned). After an unclean shutdown, the next start shows the modal "Crash Detected" dialog and waits. On an unattended host (systemd unit, headless X, kiosk, container), nobody can answer it. OBS then stays blocked with no websocket and no outputs.

This PR restores the flag:

  • With --disable-shutdown-check, OBS logs the unclean shutdown as a warning and launches in normal mode. It does not show the dialog and does not upload a crash log. The crash stays visible in the log.
  • Without the flag, the behaviour does not change.
  • --help lists the flag again.

The decision is in a new Qt-free header, frontend/utility/unclean-launch.hpp (decideUncleanLaunch()). OBSApp::checkForUncleanShutdown() uses it, and a cmocka test covers it without a display.

RED → GREEN

  • RED commit: 860b970. test_unclean_launch: 1 of 4 cases fails (unclean_with_flag_skips_prompt, the prompt is still shown). The other 3 cases pass.
  • GREEN: d978016. test_unclean_launch 4/4.

End-to-end check (not part of CI), on Debian 13, headless Xorg on :1, OBS started by a systemd unit with --disable-shutdown-check:

  1. systemctl kill -s KILL <unit>, then start the unit again.
  2. Before: the log stops at Crash or unclean shutdown detected and the dialog is open; the websocket port does not open.
  3. After: no dialog. Log line 1 is Crash or unclean shutdown detected; prompt skipped (--disable-shutdown-check), launching normally. The websocket starts and the canvas renders at the full frame rate.

Checklist

  • Base is master (or the description starts with a Stacked: note)
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): none (--disable-shutdown-check is a command-line option, not a compiler flag)
  • Intentional differences from C listed in the parity test header and rust/README.md (ports): not a port

Notes:

  • clang-format 22.1.3 and gersemi 0.25.0 were run on the changed files (no changes). The full ./lint and the local gate were not run.
  • No Rust code changes. This is a frontend fix; the frontend is not on the port plan.

🤖 Generated with Claude Code

@vpacher
vpacher requested a review from zackees as a code owner October 15, 2026 07:52
@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 15, 2026
@zackees

zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member

Thanks for the PR and the end-to-end check. Rebased onto master, set ci-full (frontend change), and ran the stamped local gate. Your RED (860b970: unclean_with_flag_skips_prompt fails) / GREEN (d978016: 4/4) evidence stands. Queued for the merge queue.

  • Rebased on master, local gate passed; pushed as b98c11b.

@zackees
zackees force-pushed the fix/disable-shutdown-check branch from d978016 to b98c11b Compare October 15, 2026 08:19
@zackees
zackees enabled auto-merge October 15, 2026 08:19
@zackees
zackees added this pull request to the merge queue Oct 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 15, 2026
@zackees
zackees enabled auto-merge October 15, 2026 11:10
vpacher and others added 2 commits October 15, 2026 04:18
Move the decision whether to show the "Crash Detected" dialog into
frontend/utility/unclean-launch.hpp (decideUncleanLaunch), free of Qt,
and add test_unclean_launch. No change in behaviour.

RED for obs-rust#809: the case "unclean shutdown + --disable-shutdown-check"
fails, because the helper still shows the prompt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
OBS 32.0 removed the flag (de997b1). After an unclean shutdown, an
unattended start (systemd unit, headless X, kiosk, container) then
blocks forever on the modal "Crash Detected" dialog.

With --disable-shutdown-check, OBS logs the unclean shutdown as a
warning and launches in normal mode, without the dialog and without a
crash log upload. Without the flag, the behaviour does not change.
The flag is listed in --help again.

GREEN for obs-rust#809 (upstream obsproject/obs-studio#12650).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd secs=1367 lanes=lint:run,rust-test:reused@241456d52183,cross:reused@b456eff62019,tier2-linux:run
Ci-Attestation: {"at":1792064466,"gate":"rust/all/fmt","host":"linux-x86_64","key":"70c3e12a6c7699758a5a5aa18481b4b98881437cb0ddc179b9075912d57ce4f8","lane":"lint","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":57,"stamp":"bb5ccb847d00dc35efbd047c93d698f5","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"run"}
Ci-Attestation: {"at":1792064466,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"70c3e12a6c7699758a5a5aa18481b4b98881437cb0ddc179b9075912d57ce4f8","lane":"lint","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":57,"stamp":"5a6cf315cc8b05ad32edca78b6a316d4","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"run"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"241456d52183502cf4b88cfa70413b65dfc08dc645f90e8d74ed72769dac7fe4","lane":"rust-test","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"666786332af5ec80ad356e838cac5ab5","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"052a7c910d2b3a22d878cbf6fc065df9","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"154247a3d324149ea0bdeb88ab116634","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"0f195b38816f63f0a8c2fcfee5151f26","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"f49ff0069782a81ac9d296091d3ff82d","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"177bb35a70786fa08588f4ac32c6d16e","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"}
Ci-Attestation: {"at":1792052374,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"b456eff62019370969ffb6f2fc0c955838c3003441e52044ffee254e4fee916f","lane":"cross","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":null,"stamp":"1745d46250f02e586d167bae850aba45","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"reused"}
Ci-Attestation: {"at":1792064466,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"7a7de4269b1cc5abc67a9021dbd420197165f50656ab9c9a50330c3151551a18","lane":"tier2-linux","parents":["4ade23676b89ed7b5081f3bae1513587736d98be"],"secs":1310,"stamp":"73366a6141493b32b371810f51280001","tree":"4946e09fe8a6ce05cef3bd51e0a4c7f0b379aedd","v":1,"via":"run"}
@zackees

zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member

Rebased onto master again: #816 merged first and added a neighbouring include in frontend/OBSApp.cpp and an entry in ui-utility.cmake, so this conflicted and left the merge queue. Resolved by keeping both (settings-migration.hpp and unclean-launch.hpp). Local gate re-stamped; re-queued.

@zackees
zackees force-pushed the fix/disable-shutdown-check branch from b98c11b to c6b031e Compare October 15, 2026 11:41
@alerque

alerque commented Oct 15, 2026

Copy link
Copy Markdown

I have no objection to restoring the flag to handle edge cases, but did the underlying problem get fixed? The real issue is that the OS issuing a shutdown does not trigger a clean exit of OBS. It should. If the system shutting down or the process manager asking for a termination (obviously not a hard kill, just a stop request) would inspire OBS to do a clean shutdown this flag would barely be needed. It's mostly being used as a bandaid for not having a way for the OS to initiate a clean shutdown.

@zackees
zackees added this pull request to the merge queue Oct 15, 2026
Merged via the queue into obs-rust:master with commit 3c5ed5f Oct 15, 2026
26 checks passed
@vpacher

vpacher commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

@alerque Agreed, a stop request must give a clean exit, and in this fork it does: processSigTerm() in frontend/OBSApp.cpp saves and exits cleanly on SIGTERM, SIGINT and SIGQUIT, so a normal systemctl stop does not trigger the prompt.

Some background on why the flag is still needed. Quite a few production setups ran OBS headless with --disable-shutdown-check. Upstream removed the flag in 32.0 with no deprecation period, and those setups broke on update. The discussion is in obsproject/obs-studio#12650.

A clean shutdown cannot be guaranteed. Power loss, the OOM killer, a SIGKILL after the stop timeout, a hard stop of the VM or container, or a real crash all leave the sentinel behind. On a desktop the prompt is useful. On a headless machine nobody can click it, so OBS waits forever: the service shows as running, but no output starts and the websocket never opens. These setups need OBS to come back by itself after an unclean stop. With the flag it does, and the unclean shutdown stays visible as a warning on log line 1.

If a flag is the wrong shape long term, one alternative would be a prompt that continues on its own after a timeout (and selects Safe Mode after several unclean starts in a row). That would make the flag mostly unnecessary.

@vpacher
vpacher deleted the fix/disable-shutdown-check branch October 15, 2026 12:48
@alerque

alerque commented Oct 16, 2026

Copy link
Copy Markdown

Oh trust me I know all about managing headless devices and understand why the flag is needed and removing it was short sighted of upstream OBS. As long as there are any lock files are other run-time artifacts being created having an override to run again in the event they don't get cleaned up is a must.

@vpacher

vpacher commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Agreed on all of it, and thanks: your question made me check that the fork already exits cleanly on SIGTERM/SIGINT/SIGQUIT, so the flag now only covers the cases where a clean exit is impossible.

For context on why I care: I run OBS headless on purpose, and I'm clearly not the only one. I wrote up the bigger picture and what already works in the fork here: #1078

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: frontend: unattended start blocks forever on the "Crash Detected" dialog after an unclean shutdown (upstream #12650)

3 participants