From 9d17c69b2280af49b0507622fd79f6e25b1d2e6e Mon Sep 17 00:00:00 2001 From: CroneKorkN Date: Sun, 10 May 2026 18:57:50 +0200 Subject: [PATCH] left4me: make chown_src self-healing too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same problem as pip_install: chown_src was triggered:True and only fired when git_deploy did. After a partial first-apply where git_deploy succeeded (extracting root-owned files) but the chown didn't happen yet, subsequent applies left files root-owned forever — pip_install fails with "permission denied" trying to write .egg-info/. Drop triggered:True. Add an unless guard: test -z "$(find /opt/left4me/src ! -user left4me -print -quit)" i.e. skip the chown only when no non-left4me-owned file exists in the tree. --- bundles/left4me/items.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundles/left4me/items.py b/bundles/left4me/items.py index 26ba38d..f2eb040 100644 --- a/bundles/left4me/items.py +++ b/bundles/left4me/items.py @@ -144,8 +144,11 @@ git_deploy = { } actions['left4me_chown_src'] = { + # Runs every apply (cheap — chown -R on a small tree). Self-heals + # whenever git_deploy extracts a new tarball as root-owned files. + # Not in any triggers list so doesn't need triggered:True. 'command': 'chown -R left4me:left4me /opt/left4me/src', - 'triggered': True, + 'unless': 'test -z "$(find /opt/left4me/src \\! -user left4me -print -quit 2>/dev/null)"', 'cascade_skip': False, 'needs': [ 'git_deploy:/opt/left4me/src',