Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node and cluster state/ dirs permissions #627

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions core/imageroot/var/lib/nethserver/cluster/state/.gitignore

This file was deleted.

2 changes: 2 additions & 0 deletions core/imageroot/var/lib/nethserver/node/install-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ echo "Add firewalld core rules:"
)

echo "Write initial cluster environment state"
mkdir -v -m 0700 /var/lib/nethserver/cluster/state
(exec > /var/lib/nethserver/cluster/state/environment
printf "NODE_ID=1\n"
)
echo "Write initial node environment state"
mkdir -v -m 0700 /var/lib/nethserver/node/state
(exec > /var/lib/nethserver/node/state/environment
printf "NODE_ID=1\n"
printf "IMAGE_ID=%s\n" $(podman image inspect -f '{{.Id}}' "${CORE_IMAGE}")
Expand Down
4 changes: 0 additions & 4 deletions core/imageroot/var/lib/nethserver/node/state/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
exec 1>&2
set -e

chmod -c 0700 /var/lib/nethserver/{node,cluster}/state

if ! grep -q '^PATH=' /var/lib/nethserver/node/state/agent.env ; then
echo "Fixing PATH in node agent.env"
printf "PATH=/var/lib/nethserver/node/bin:/usr/local/agent/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/agent/bin\n" >> /var/lib/nethserver/node/state/agent.env
Expand All @@ -27,4 +29,3 @@ if ! grep -q '^PYTHONPATH=' /var/lib/nethserver/cluster/state/agent.env ; then
echo "Fixing PYTHONPATH in cluster agent.env"
printf "PYTHONPATH=/var/lib/nethserver/cluster/pypkg\n" >> /var/lib/nethserver/cluster/state/agent.env
fi

Loading