From f1da10649e8512389f07d857d5a2c0b9905e7b56 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Tue, 24 Dec 2024 22:19:13 -0700 Subject: [PATCH] fixup! python: Add script to work with systemd-nspawn Signed-off-by: Nathan Chancellor --- python/scripts/sd_nspawn.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/scripts/sd_nspawn.py b/python/scripts/sd_nspawn.py index 3d96582e..1fcf8cba 100755 --- a/python/scripts/sd_nspawn.py +++ b/python/scripts/sd_nspawn.py @@ -104,6 +104,15 @@ def _add_dynamic_mounts(self, name): self.data['Files']['Bind'].append(item) for mount in ro_mounts: + # If it is a temporary directory that does not exist already, just + # created it so that the next check passes. + if mount.startswith('/var/tmp'): + Path(mount).mkdir(exist_ok=True) + # tmux specifically checks to make sure the permissions of the + # directory are restrictive and refuses to connect if they are + # not right so fix them up. + if 'tmux-' in mount: + Path(mount).chmod(0o700) if Path(mount).exists(): self.data['Files']['BindReadOnly'].append(mount)