From 54d88eec7ea63a1f6c2add2329c0e58eacc4e689 Mon Sep 17 00:00:00 2001 From: josegonzalez Date: Fri, 17 Feb 2023 19:10:14 -0500 Subject: [PATCH] fix: only rsync existing directories Additionally, pin the chown to just the top-level dir for the services dir --- docker/etc/my_init.d/10_dokku_init | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/etc/my_init.d/10_dokku_init b/docker/etc/my_init.d/10_dokku_init index c79db82b1..16dfe520d 100755 --- a/docker/etc/my_init.d/10_dokku_init +++ b/docker/etc/my_init.d/10_dokku_init @@ -41,13 +41,15 @@ main() { if [[ ! -e "$dir" ]]; then log-info "Copying ${dir} skel into place" mkdir -p "/mnt/dokku${dir}" - if [[ -d "$dir" ]]; then + if [[ -d "/skel${dir}" ]]; then rsync -a "/skel${dir}/" "${dir}/" || log-fail "Unable to copy ${dir} skel into place" fi fi # chown mount directories to "dokku:dokku" - if [[ "$dir" != "/etc/ssh" ]]; then + if [[ "$dir" == "/var/lib/dokku/services" ]]; then + chown dokku:dokku /var/lib/dokku/services + elif [[ "$dir" != "/etc/ssh" ]]; then find "$dir" -print0 | xargs -0 chown -h dokku:dokku fi done