1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

lorri: don't start until daemon is really running

Sometimes a race condition will make the events stream start after the
daemon is running, and then no events will be streamed.

This fixes the problem by checking the daemon status and failing the
unit if not ready yet. It will restart 5 seconds later, which will
probably be enough.

@moduon MT-1075
This commit is contained in:
Jairo Llopis 2025-10-24 12:47:34 +01:00 committed by Austin Horstman
parent d9ded14b74
commit 80437a57ca

View file

@ -100,6 +100,12 @@ in
}; };
Service = { Service = {
# Don't start until lorri daemon is actually running
ExecStartPre = pkgs.writeShellScript "lorri-notify-check" ''
lorri info --shell-file . | grep 'Lorri Daemon Status:.*running'
'';
RestartSec = "5s";
ExecStart = ExecStart =
let let
jqFile = '' jqFile = ''
@ -129,6 +135,7 @@ in
with pkgs; with pkgs;
[ [
bash bash
gnugrep
jq jq
libnotify libnotify
cfg.package cfg.package