From 725b84be18907fb3c4ab00f3a0394c774d8ab67f Mon Sep 17 00:00:00 2001 From: Robin Stumm Date: Wed, 19 Apr 2017 01:05:55 +0200 Subject: [PATCH 1/2] znapzend service: fix reload --- nixos/modules/services/backup/znapzend.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix index 648089f90b7..6dd455cb757 100644 --- a/nixos/modules/services/backup/znapzend.nix +++ b/nixos/modules/services/backup/znapzend.nix @@ -23,11 +23,11 @@ in path = with pkgs; [ znapzend zfs mbuffer openssh ]; script = '' - znapzend + exec znapzend ''; reload = '' - /bin/kill -HUP $MAINPID + ${pkgs.coreutils}/bin/kill -HUP $MAINPID ''; }; }; From 8174b447a2a4e515990dbf567ca53348977f2fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 19 Apr 2017 13:56:51 +0200 Subject: [PATCH 2/2] znapsend: do not spawn a shell in the service --- nixos/modules/services/backup/znapzend.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix index 6dd455cb757..35c0308c9dc 100644 --- a/nixos/modules/services/backup/znapzend.nix +++ b/nixos/modules/services/backup/znapzend.nix @@ -20,15 +20,12 @@ in description = "ZnapZend - ZFS Backup System"; after = [ "zfs.target" ]; - path = with pkgs; [ znapzend zfs mbuffer openssh ]; + path = with pkgs; [ zfs mbuffer openssh ]; - script = '' - exec znapzend - ''; - - reload = '' - ${pkgs.coreutils}/bin/kill -HUP $MAINPID - ''; + serviceConfig = { + ExecStart = "${pkgs.znapzend}/bin/znapzend"; + ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; + }; }; };