Skip to content

Commit

Permalink
Disable SELinux
Browse files Browse the repository at this point in the history
Because it's 2023, and the DPK still doesn't play well with SELinux.
  • Loading branch information
iversond committed Mar 18, 2023
1 parent 031251e commit db20931
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions scripts/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ function install_prereqs() {
update_packages
install_additional_packages
start_smb
set_permissivie_selinux
#set_permissivie_selinux
disable_selinux
}

function start_smb() {
Expand All @@ -130,13 +131,31 @@ function start_smb() {
fi
}

function set_permissivie_selinux() {
echodebug "Set SELinux to Permissive"
# function set_permissivie_selinux() {
# echodebug "Set SELinux to Permissive"
# if [[ -n ${DEBUG+x} ]]; then
# echo 0 | sudo tee /sys/fs/selinux/enforce
# else
# echo 0 | sudo tee /sys/fs/selinux/enforce > /dev/null 2>&1
# fi
# }

# Per 2817926.1, DPK doesn't play well with SELinux, in 2023
function disable_selinux(){
local begin=$(date +%s)
echoinfo "Disable SELinux for PeopleSoft Images"

if [[ -n ${DEBUG+x} ]]; then
echo 0 | sudo tee /sys/fs/selinux/enforce
else
echo 0 | sudo tee /sys/fs/selinux/enforce > /dev/null 2>&1
sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
else
sudo setenforce 0 > /dev/null 2>&1
sudo sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config > /dev/null 2>&1
fi

local end=$(date +%s)
local tottime="$((end - begin))"
timings[disable_selinux]=$tottime
}

function check_dpk_install_dir() {
Expand Down

0 comments on commit db20931

Please sign in to comment.