Restore SELinux tags after install

This commit is contained in:
Lucas Bickel 2017-03-13 14:10:29 +01:00
parent d2ffb6d91d
commit 9a6d5b0175
2 changed files with 21 additions and 2 deletions

2
Vagrantfile vendored
View File

@ -46,7 +46,7 @@ Vagrant.configure("2") do |config|
end end
config.vm.define "centos" do |os| config.vm.define "centos" do |os|
os.vm.box = 'centos/7' os.vm.box = 'centos/7'
provision_libretime(os, "centos.sh", installer_args + "--ignore-dependencies --distribution=centos --web-user=apache") provision_libretime(os, "centos.sh", installer_args + "--ignore-dependencies --distribution=centos --web-user=apache --selinux")
end end
def provision_libretime(config, prepare_script, installer_args) def provision_libretime(config, prepare_script, installer_args)

21
install
View File

@ -49,7 +49,10 @@ showhelp () {
-a, --apache -a, --apache
Install apache and deploy a basic configuration for Airtime Install apache and deploy a basic configuration for Airtime
-i, --icecast -i, --icecast
Install Icecast 2 and deploy a basic configuration for Airtime" Install Icecast 2 and deploy a basic configuration for Airtime
--selinux
Run restorecon on directories and files that need tagging to
allow the WEB_USER access."
exit 0 exit 0
} }
@ -67,6 +70,7 @@ postgres="f"
apache="f" apache="f"
icecast="f" icecast="f"
ignore_dependencies="f" ignore_dependencies="f"
selinux="f"
# Interactive # Interactive
_i=1 _i=1
# Verbose # Verbose
@ -223,6 +227,9 @@ while :; do
--web-port=?*) --web-port=?*)
web_port=${1#*=} web_port=${1#*=}
;; ;;
--selinux)
selinux="t"
;;
--) --)
shift shift
break break
@ -747,6 +754,18 @@ if [ "$ignore_dependencies" = "f" ]; then
fi fi
fi fi
# If the user requested it we run restorecon on files that need
# tagging for selinux.
if [ "$selinux" = "t" ]; then
loud "\n-----------------------------------------------------"
loud " * Restoring SELinux Tags * "
loud "-----------------------------------------------------"
verbose "\n * Running restorecon..."
loudCmd "restorecon -Rv /etc/airtime /srv/airtime > /dev/null 2>&1"
verbose "...Done"
fi
verbose "\n * Reloading apache..." verbose "\n * Reloading apache..."
if [ "$dist" != "centos" ]; then if [ "$dist" != "centos" ]; then
loudCmd "service ${apache_bin} reload 2>/dev/null" loudCmd "service ${apache_bin} reload 2>/dev/null"