summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-04-18 11:00:56 +0200
committertv <tv@krebsco.de>2019-04-18 11:00:56 +0200
commit1bbd53c4599fd1148bdb864f981b6fd4563fb476 (patch)
treeeaf62cd748dbf1980d71f64f9e6364dd65b94966 /krebs/3modules
parent64d6955e5a238016a1c6119516cb07caec4da4e5 (diff)
krebs.permown: admit symlinks
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/permown.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/krebs/3modules/permown.nix b/krebs/3modules/permown.nix
index f190bf86a..0f2ba86c8 100644
--- a/krebs/3modules/permown.nix
+++ b/krebs/3modules/permown.nix
@@ -61,7 +61,7 @@ with import <stockholm/lib>;
ExecStart = pkgs.writeDash "permown" ''
set -efu
- find "$ROOT_PATH" -exec chown "$OWNER_GROUP" {} +
+ find "$ROOT_PATH" -exec chown -h "$OWNER_GROUP" {} +
find "$ROOT_PATH" -type d -exec chmod "$DIR_MODE" {} +
find "$ROOT_PATH" -type f -exec chmod "$FILE_MODE" {} +
@@ -70,8 +70,10 @@ with import <stockholm/lib>;
if test -d "$path"; then
exec "$0" "$@"
fi
- chown "$OWNER_GROUP" "$path"
- chmod "$FILE_MODE" "$path"
+ chown -h "$OWNER_GROUP" "$path"
+ if test -f "$path"; then
+ chmod "$FILE_MODE" "$path"
+ fi
done
'';
Restart = "always";