From 9b39fd7eb4468781ac0e72c32fc5f86bc9f0f7ea Mon Sep 17 00:00:00 2001 From: Dmitry Kulikov <0qqw0qqw@gmail.com> Date: Tue, 15 Jun 2021 20:27:35 +0300 Subject: [PATCH] sxhkd: stop scope before creating (#2086) --- modules/services/sxhkd.nix | 1 + tests/modules/services/sxhkd/service.nix | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/services/sxhkd.nix b/modules/services/sxhkd.nix index 031722a0f..1187b5ed3 100644 --- a/modules/services/sxhkd.nix +++ b/modules/services/sxhkd.nix @@ -73,6 +73,7 @@ in ]; xsession.initExtra = '' + systemctl --user stop sxhkd.scope 2> /dev/null || true systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd \ ${cfg.package}/bin/sxhkd ${toString cfg.extraOptions} & ''; diff --git a/tests/modules/services/sxhkd/service.nix b/tests/modules/services/sxhkd/service.nix index 2e26bb493..60115148b 100644 --- a/tests/modules/services/sxhkd/service.nix +++ b/tests/modules/services/sxhkd/service.nix @@ -2,8 +2,9 @@ let expectedFileRegex = '' - systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd \ - @sxhkd@/bin/sxhkd -m 1 & + systemctl --user stop sxhkd.scope 2> /dev/null || true + systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd \ + @sxhkd@/bin/sxhkd -m 1 & ''; in