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)