summary refs log tree commit diff
path: root/nixos/modules/services/networking/smokeping.nix
diff options
context:
space:
mode:
authorMarius Bergmann <marius@yeai.de>2016-11-02 10:55:39 +0100
committerMarius Bergmann <marius@yeai.de>2016-11-02 13:18:57 +0100
commit248bf519c9b29a93684d5bb900046d5d0ef1d26e (patch)
tree849e90a8faeb3abe00a56ba5f27af0a1e3945702 /nixos/modules/services/networking/smokeping.nix
parentf64933596c58329d59eae7485f4868b53955fc3a (diff)
downloadnixpkgs-248bf519c9b29a93684d5bb900046d5d0ef1d26e.tar
nixpkgs-248bf519c9b29a93684d5bb900046d5d0ef1d26e.tar.gz
nixpkgs-248bf519c9b29a93684d5bb900046d5d0ef1d26e.tar.bz2
nixpkgs-248bf519c9b29a93684d5bb900046d5d0ef1d26e.tar.lz
nixpkgs-248bf519c9b29a93684d5bb900046d5d0ef1d26e.tar.xz
nixpkgs-248bf519c9b29a93684d5bb900046d5d0ef1d26e.tar.zst
nixpkgs-248bf519c9b29a93684d5bb900046d5d0ef1d26e.zip
smokeping service: Fix permissions in $smokepingHome
In the prestart config of the smokeping service, smokeping is executed
initially. This happens as the user root and writes some files to
$smokepingHome, which can't be overwritten by the smokeping user. This
gives an error message.

I fixed this by moving the chown step after the initial smokeping runs,
so that it also affects the generated files.
Diffstat (limited to 'nixos/modules/services/networking/smokeping.nix')
-rw-r--r--nixos/modules/services/networking/smokeping.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/smokeping.nix b/nixos/modules/services/networking/smokeping.nix
index 0c1f8d8cdb9..6084dbdbf78 100644
--- a/nixos/modules/services/networking/smokeping.nix
+++ b/nixos/modules/services/networking/smokeping.nix
@@ -284,10 +284,10 @@ in
         mkdir -m 0755 -p ${smokepingHome}/cache ${smokepingHome}/data
         rm -f ${smokepingHome}/cropper
         ln -s ${cfg.package}/htdocs/cropper ${smokepingHome}/cropper
-        chown -R ${cfg.user} ${smokepingHome}
         cp ${cgiHome} ${smokepingHome}/smokeping.fcgi
         ${cfg.package}/bin/smokeping --check --config=${configPath}
         ${cfg.package}/bin/smokeping --static --config=${configPath}
+        chown -R ${cfg.user} ${smokepingHome}
       '';
       script = ''${cfg.package}/bin/smokeping --config=${configPath} --nodaemon'';
     };