mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-28 21:32:20 +00:00
fix(netboot): correct SELinux assignments in postinstall profiles
Match the complete enforcing or permissive setting. Preserve comments and whitespace, and do not change unrelated lines or create a missing policy file.
This commit is contained in:
@@ -37,7 +37,7 @@ END
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
#--for redhat 8 and 8.1
|
||||
#-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys
|
||||
|
||||
@@ -37,7 +37,7 @@ echo "co:2345:respawn:/sbin/agetty -L 38400 console" >> $installroot/etc/inittab
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
|
||||
#--for redhat 8 and 8.1
|
||||
|
||||
@@ -37,7 +37,7 @@ END
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
#--for redhat 8 and 8.1
|
||||
#-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys
|
||||
|
||||
@@ -37,7 +37,7 @@ echo "co:2345:respawn:/sbin/agetty -L 38400 console" >> $installroot/etc/inittab
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
|
||||
#-- Example of booted image versioning
|
||||
|
||||
@@ -37,7 +37,7 @@ END
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
|
||||
#-- Example of booted image versioning
|
||||
|
||||
@@ -37,7 +37,7 @@ echo "co:2345:respawn:/sbin/agetty -L 38400 console" >> $installroot/etc/inittab
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
|
||||
#--for redhat 8 and 8.1
|
||||
|
||||
@@ -37,7 +37,7 @@ END
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
#--for redhat 8 and 8.1
|
||||
#-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys
|
||||
|
||||
@@ -37,7 +37,7 @@ echo "co:2345:respawn:/sbin/agetty -L 38400 console" >> $installroot/etc/inittab
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
|
||||
#--for redhat 8 and 8.1
|
||||
|
||||
@@ -37,7 +37,7 @@ END
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
#--for redhat 8 and 8.1
|
||||
#-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys
|
||||
|
||||
@@ -41,7 +41,7 @@ echo "co:2345:respawn:/sbin/agetty -L 38400 console" >> $installroot/etc/inittab
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
|
||||
#-- Example of booted image versioning
|
||||
|
||||
@@ -37,7 +37,7 @@ END
|
||||
#-- Need to disable selinux, otherwise, the booting will hang on "Loading selinux policy"
|
||||
if [ -f "$installroot/etc/selinux/config" ]
|
||||
then
|
||||
sed -i 's/SELINUX=enforcing\|permissive/SELINUX=disabled/' $installroot/etc/selinux/config
|
||||
sed -i 's/^\([[:blank:]]*SELINUX=\)\(enforcing\|permissive\)\([[:blank:]]*\(#.*\)\{0,1\}\)$/\1disabled\3/' "$installroot/etc/selinux/config"
|
||||
fi
|
||||
#--for redhat 8 and 8.1
|
||||
#-- Need to disable firewalld, otherwise, the remoteshell script will not able to get all the SSH keys
|
||||
|
||||
Reference in New Issue
Block a user