Skip to content

Conversation

@tscolari
Copy link

@tscolari tscolari commented Apr 22, 2025

The existing pre-sleep script introduced by DisplayLink causes the system to halt/wait forever when the machine goes into sleep but is not plugged in to the monitor/has displayManager running.

This manifests by the system actually staying awake, and any future calls to sleep/shutdown are ignored because the system is already in the process of going to sleep. More information of the issue here: #281104

This fix is based on the fact that the current script will wait forever on the output of the DisplayLink's pipe if the DisplayLinkManager is not running (which also means the file won't exist).
The new script will check the presence of the in/out pipe files (therefore if DisplayLink is running), before trying to read from it.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: hardware Drivers, Firmware and Kernels labels Apr 22, 2025
The current script will wait forever for the output pipe when
DisplayLink is not running, this happens because flushing the
bytes are done without checking if the output pipe exists.
Which makes the read timeout to be ignored, and the whole script
being blocked waiting for the file to exist.

This changes the script to test if both pipes are up before any action,
this is a good indicative that the DisplayLinkManager is running.
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 22, 2025
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/weird-behaviour-after-suspend-gnome/38210/8

tscolari added a commit to tscolari/nixfiles that referenced this pull request Apr 23, 2025
@nixpkgs-ci nixpkgs-ci bot added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jun 25, 2025
@nixpkgs-ci nixpkgs-ci bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 4, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: hardware Drivers, Firmware and Kernels 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants