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

nixos/services.imwheel: sleep 3s before restarting #95986

Merged
merged 1 commit into from Aug 22, 2020

Conversation

turboMaCk
Copy link
Member

Motivation for this change

Imwheel service required restarting (systemctl; --user restart imwheel.service) in order to start working. Probably because it was racing with some other services initialization.

Things done

Delay imwheel start by 3s (value taken from redshift) to prevent the issue.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@turboMaCk turboMaCk changed the title services.imwheel: sleep 3s before restarting nixos/services.imwheel: sleep 3s before restarting Aug 22, 2020
@turboMaCk
Copy link
Member Author

cc @infinisil

@infinisil
Copy link
Member

What's the error when starting without this delay?

@turboMaCk
Copy link
Member Author

turboMaCk commented Aug 22, 2020

There is no error. Even systemctl --user status shows everything is fine but imwheel does nothing. For instance if you would use imwheel to set high speed of scrolling wheel, after the boot / start of session this would not take any effect. Service is running but has no effect at all. After restarting the service, imwheel would start working. I don't really know how imwheel works but it seems it's racing with something and if it starts too early it simply doesn't work.

@infinisil
Copy link
Member

No logs in journalctl --user -u imwheel -e?

@turboMaCk
Copy link
Member Author

@infinisil no, only successes. This is the log from several reboots.

-- Reboot --
Aug 22 13:59:11 nixos-mainframe systemd[1976]: Started imwheel service.
Aug 22 13:59:11 nixos-mainframe imwheel[2051]: INFO: imwheel is not running as a daemon.
Aug 22 13:59:11 nixos-mainframe imwheel[2051]: INFO: imwheel started (pid=2051)
Aug 22 13:59:11 nixos-mainframe systemd[1976]: imwheel.service: Succeeded.
-- Reboot --
Aug 22 14:23:36 nixos-mainframe systemd[1984]: Started imwheel service.
Aug 22 14:23:36 nixos-mainframe imwheel[2061]: INFO: imwheel is not running as a daemon.
Aug 22 14:23:36 nixos-mainframe imwheel[2061]: INFO: imwheel started (pid=2061)
Aug 22 14:23:37 nixos-mainframe systemd[1984]: imwheel.service: Succeeded.
-- Reboot --
Aug 22 14:40:32 nixos-mainframe systemd[1977]: Started imwheel service.
Aug 22 14:40:32 nixos-mainframe imwheel[2045]: INFO: imwheel is not running as a daemon.
Aug 22 14:40:32 nixos-mainframe imwheel[2045]: INFO: imwheel started (pid=2045)
Aug 22 14:40:32 nixos-mainframe systemd[1977]: imwheel.service: Succeeded.

@infinisil
Copy link
Member

Hm well I guess if we can't figure out the actual cause, this is the next best thing.

@infinisil
Copy link
Member

Oof and I'm also just noticing that this package hasn't seen an update in 16 years! Is there nothing more maintained out there?

@turboMaCk
Copy link
Member Author

I'm not much happy about this either. It always feels deeply wrong to fix synchronization issues with sleep. The only reason why I was brave enough to open this PR was that I've seen redshift service uses this as well.

Yes the package is old as hell. I'm not a maintainer of the package itself. That's being said I also used it several years ago on Arch (https://wiki.archlinux.org/index.php/IMWheel). I'm not really sure about alternatives but we can definitely look into it. Anyway in case we would find something neater I would still be in favor of merging this fix for folks out there and then adding some deprecation notice with recommendation of switching to alternative.

@infinisil infinisil merged commit af1ac75 into NixOS:master Aug 22, 2020
@turboMaCk turboMaCk deleted the imwheel-service branch February 2, 2021 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants