Skip to content

Commit

Permalink
fixup! python: Add script to work with systemd-nspawn
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Dec 25, 2024
1 parent c39a018 commit f1da106
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/scripts/sd_nspawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f1da106

Please sign in to comment.