From 1bbd53c4599fd1148bdb864f981b6fd4563fb476 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 18 Apr 2019 11:00:56 +0200 Subject: krebs.permown: admit symlinks --- krebs/3modules/permown.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'krebs') 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 ; 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 ; 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"; -- cgit v1.2.3