Skip to content

Commit

Permalink
Revert "[PLAT-16762] Run semanage fcontext irrespective of the SELinu…
Browse files Browse the repository at this point in the history
…x enforcing mode"

Summary: This reverts commit fb1f78b.

Test Plan: Revert the change.

Reviewers: dshubin, anijhawan

Reviewed By: dshubin, anijhawan

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D42222
  • Loading branch information
nkhogen committed Feb 28, 2025
1 parent e44420b commit b78fd33
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions managed/node-agent/resources/node-agent-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ check_sudo_access() {
elif sudo -n pwd >/dev/null 2>&1; then
SUDO_ACCESS="true"
fi
if [ "$OS" = "Linux" ]; then
SE_LINUX_STATUS=$(getenforce 2>/dev/null)
fi
set -e
}

Expand All @@ -266,15 +269,7 @@ modify_firewall() {
}

modify_selinux() {
if [ "$OS" != "Linux" ]; then
echo "OS $OS is not Linux. Skipping SELinux configuration"
return
fi
set +e
se_linux_status=$(getenforce 2>/dev/null)
if [ "$se_linux_status" = "Enforcing" ]; then
echo "SELinux is in $se_linux_status mode"
fi
if ! command -v semanage >/dev/null 2>&1; then
if [ "$AIRGAP_INSTALL" = "true" ]; then
# The changes made with chcon are temporary in the sense that the context of the file
Expand Down Expand Up @@ -345,7 +340,9 @@ install_systemd_service() {
SYSTEMD_PATH="$INSTALL_USER_HOME/.config/systemd/user"
fi
if [ "$USER_SCOPED_UNIT" = "false" ]; then
modify_selinux
if [ "$SE_LINUX_STATUS" = "Enforcing" ]; then
modify_selinux
fi
modify_firewall
fi
echo "* Installing Node Agent Systemd Service"
Expand Down

0 comments on commit b78fd33

Please sign in to comment.