diff options
Diffstat (limited to 'accounts/gkleen@sif/systemd.nix')
-rw-r--r-- | accounts/gkleen@sif/systemd.nix | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index de28895e..e6133896 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix | |||
@@ -22,20 +22,15 @@ let | |||
22 | 22 | ||
23 | ( exec -a "''${cmd[1]}" -- ''${cmd} ) & | 23 | ( exec -a "''${cmd[1]}" -- ''${cmd} ) & |
24 | pid=$! | 24 | pid=$! |
25 | ${pkgs.systemd}/bin/systemd-notify --pid="''${pid}" | ||
26 | 25 | ||
27 | check_pid() { | 26 | newpid="" |
28 | ${pkgs.lsof}/bin/lsof -Pi @localhost:"''${port}" -sTCP:LISTEN -t | 27 | while ! newpid=$(${pkgs.lsof}/bin/lsof -Pi @localhost:"''${port}" -sTCP:LISTEN -t); do |
29 | } | ||
30 | |||
31 | while ! check_pid; do | ||
32 | ${pkgs.coreutils}/bin/sleep 0.1 | 28 | ${pkgs.coreutils}/bin/sleep 0.1 |
33 | done | 29 | done |
34 | 30 | ||
35 | ${pkgs.systemd}/bin/systemd-notify --pid=$(check_pid) | ||
36 | ${pkgs.systemd}/bin/systemd-notify --ready | 31 | ${pkgs.systemd}/bin/systemd-notify --ready |
37 | 32 | ||
38 | wait "''${pid}" | 33 | wait "''${pid}" "''${newpid}" |
39 | ''; | 34 | ''; |
40 | in { | 35 | in { |
41 | services = { | 36 | services = { |