From b41e5b23158d0a8e05b1620d3599b19a56a716cd Mon Sep 17 00:00:00 2001 From: Martin Lablans Date: Wed, 5 Oct 2022 19:58:07 +0200 Subject: [PATCH] Fix permissions on startup. Requires re-install of systemd units. --- bridgehead | 3 +++ lib/systemd/bridgehead-update@.service | 1 + lib/systemd/bridgehead@.service | 1 + 3 files changed, 5 insertions(+) diff --git a/bridgehead b/bridgehead index 85d9348..eba542d 100755 --- a/bridgehead +++ b/bridgehead @@ -65,6 +65,9 @@ case "$ACTION" in uninstall) exec ./lib/remove-bridgehead-units.sh $PROJECT ;; + fixPermissions) + chown -R bridgehead /etc/bridgehead . + ;; *) printUsage exit 1 diff --git a/lib/systemd/bridgehead-update@.service b/lib/systemd/bridgehead-update@.service index c1d8b4c..e8b42ea 100644 --- a/lib/systemd/bridgehead-update@.service +++ b/lib/systemd/bridgehead-update@.service @@ -4,6 +4,7 @@ Description=Bridgehead (%i) Update Service [Service] Type=oneshot User=bridgehead +ExecStartPre=-/srv/docker/bridgehead/bridgehead fixPermissions %i ExecStart=/srv/docker/bridgehead/bridgehead update %i [Install] diff --git a/lib/systemd/bridgehead@.service b/lib/systemd/bridgehead@.service index c387c71..f109e5a 100644 --- a/lib/systemd/bridgehead@.service +++ b/lib/systemd/bridgehead@.service @@ -6,6 +6,7 @@ Requires=docker.service User=bridgehead Restart=always RestartSec=30 +ExecStartPre=-/srv/docker/bridgehead/bridgehead fixPermissions %i ExecStart=/srv/docker/bridgehead/bridgehead start %i ExecStop=/srv/docker/bridgehead/bridgehead stop %i