Merge "Support install.sh for installing compass onto centos7"

This commit is contained in:
Jenkins 2015-12-19 07:00:42 +00:00 committed by Gerrit Code Review
commit 574a22e252
11 changed files with 136 additions and 125 deletions

View File

@ -1,22 +1,22 @@
#!/bin/bash #!/bin/bash
set -e set -e
service mysqld restart systemctl restart mariadb.service
service mysqld status || exit $? systemctl status mariadb.service || exit $?
/opt/compass/bin/manage_db.py createdb /opt/compass/bin/manage_db.py createdb
/opt/compass/bin/clean_installers.py --noasync /opt/compass/bin/clean_installers.py --noasync
/opt/compass/bin/clean_installation_logs.py /opt/compass/bin/clean_installation_logs.py
rm -rf /var/ansible/run/* rm -rf /var/ansible/run/*
service httpd restart systemctl restart httpd.service
service httpd status || exit $? systemctl status httpd.service || exit $?
service rsyslog restart systemctl restart rsyslog.service
service rsyslog status || exit $? systemctl status rsyslog.service || exit $?
service redis restart systemctl restart redis.service
service redis status || exit $? systemctl status redis.service || exit $?
redis-cli flushall redis-cli flushall
service cobblerd restart systemctl restart cobblerd.service
service cobblerd status || exit $? systemctl status cobblerd.service || exit $?
service compass-celeryd restart systemctl restart compass-celeryd.service
service compass-celeryd status || exit $? systemctl status compass-celeryd.service || exit $?
service compass-progress-updated restart systemctl restart compass-progress-updated.service
service compass-progress-updated status || exit $? systemctl status compass-progress-updated.service || exit $?

View File

@ -13,13 +13,14 @@ fi
source $DIR/install_func.sh source $DIR/install_func.sh
echo "Installing cobbler related packages" echo "Installing cobbler related packages"
sudo yum -y install cobbler cobbler-web createrepo mkisofs python-cheetah python-simplejson python-urlgrabber PyYAML Django cman debmirror pykickstart reprepro sudo yum -y install cobbler cobbler-web createrepo mkisofs python-cheetah python-simplejson python-urlgrabber PyYAML Django corosync pykickstart
sudo yum -y upgrade yum-utils
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "failed to install cobbler related packages" echo "failed to install cobbler related packages"
exit 1 exit 1
else #else
# patch cobbler code # patch cobbler code
find /usr/lib -name manage_bind.py |xargs perl -pi.old -e 's/(\s+)(self\.logger\s+\= logger)/$1$2\n$1if self\.logger is None:\n$1 import clogger\n$1 self\.logger = clogger.Logger\(\)/' # find /usr/lib -name manage_bind.py |xargs perl -pi.old -e 's/(\s+)(self\.logger\s+\= logger)/$1$2\n$1if self\.logger is None:\n$1 import clogger\n$1 self\.logger = clogger.Logger\(\)/'
fi fi
# cobbler snippet uses netaddr to calc subnet and ip addr # cobbler snippet uses netaddr to calc subnet and ip addr
@ -29,7 +30,7 @@ if [[ "$?" != "0" ]]; then
exit 1 exit 1
fi fi
sudo chkconfig cobblerd on sudo systemctl enable cobblerd.service
# create backup dir # create backup dir
sudo mkdir -p /root/backup/cobbler sudo mkdir -p /root/backup/cobbler
@ -142,16 +143,15 @@ sudo cp -rf $ADAPTERS_HOME/cobbler/conf/cobbler.conf /etc/httpd/conf.d/
chmod 644 /etc/httpd/conf.d/cobbler.conf chmod 644 /etc/httpd/conf.d/cobbler.conf
sudo cp -rn /etc/xinetd.d /root/backup/ sudo cp -rn /etc/xinetd.d /root/backup/
sudo sed -i 's/disable\([ \t]\+\)=\([ \t]\+\)yes/disable\1=\2no/g' /etc/xinetd.d/rsync sudo cp $COMPASSDIR/misc/rsync /etc/xinetd.d/
sudo sed -i 's/^@dists=/# @dists=/g' /etc/debmirror.conf exit 0
sudo sed -i 's/^@arches=/# @arches=/g' /etc/debmirror.conf #sudo sed -i 's/^@dists=/# @dists=/g' /etc/debmirror.conf
#sudo sed -i 's/^@arches=/# @arches=/g' /etc/debmirror.conf
sudo rm -rf /var/lib/cobbler/config/systems.d/* sudo rm -rf /var/lib/cobbler/config/systems.d/*
echo "disable iptables" echo "disable iptables"
sudo service iptables stop sudo systemctl stop firewalld
sudo sleep 10
sudo service iptables status
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
echo "iptables is running" echo "iptables is running"
exit 1 exit 1
@ -159,8 +159,8 @@ else
echo "iptables is already stopped" echo "iptables is already stopped"
fi fi
echo "disable selinux temporarily" # echo "disable selinux temporarily"
echo 0 > /selinux/enforce # echo 0 > /selinux/enforce
# make log dir # make log dir
sudo mkdir -p /var/log/cobbler sudo mkdir -p /var/log/cobbler
@ -168,15 +168,9 @@ sudo mkdir -p /var/log/cobbler/tasks
sudo mkdir -p /var/log/cobbler/anamon sudo mkdir -p /var/log/cobbler/anamon
sudo chmod -R 777 /var/log/cobbler sudo chmod -R 777 /var/log/cobbler
# kill dnsmasq service sudo systemctl restart httpd.service
if `sudo chkconfig --list dnsmasq`; then sudo systemctl restart cobblerd.service
sudo chkconfig dnsmasq off sudo systemctl restart named.service
sudo service dnsmasq stop
fi
sudo killall -9 dnsmasq
sudo service httpd restart
sudo service cobblerd restart
sudo cobbler get-loaders sudo cobbler get-loaders
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
@ -194,12 +188,12 @@ else
echo "cobbler synced" echo "cobbler synced"
fi fi
sudo service xinetd restart sudo systemctl restart xinetd.service
sudo sleep 10 sudo sleep 10
echo "Checking if httpd is running" echo "Checking if httpd is running"
sudo service httpd status sudo systemctl status httpd.service
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
echo "httpd is running." echo "httpd is running."
else else
@ -208,7 +202,7 @@ else
fi fi
echo "Checking if dhcpd is running" echo "Checking if dhcpd is running"
sudo service dhcpd status sudo systemctl status dhcpd.service
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
echo "dhcpd is running." echo "dhcpd is running."
else else
@ -217,7 +211,7 @@ else
fi fi
echo "Checking if named is running" echo "Checking if named is running"
sudo service named status sudo systemctl status named.service
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
echo "named is running." echo "named is running."
else else
@ -226,7 +220,7 @@ else
fi fi
echo "Checking if xinetd is running" echo "Checking if xinetd is running"
sudo service xinetd status sudo systemctl status xinetd.service
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
echo "xinetd is running." echo "xinetd is running."
else else
@ -235,7 +229,7 @@ else
fi fi
echo "Checking if cobblerd is running" echo "Checking if cobblerd is running"
sudo service cobblerd status sudo systemctl status cobblerd.service
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
echo "cobblerd is running." echo "cobblerd is running."
else else
@ -394,7 +388,6 @@ if [[ $SUPPORT_SLES_11SP3 == "y" ]]; then
download -u "$SLES_11SP3_PPA_REPO_SOURCE" -u "$SLES_11SP3_PPA_REPO_SOURCE_ASIA" sles_11sp3_ppa_repo.tar.gz unzip /var/lib/cobbler/repo_mirror || exit $? download -u "$SLES_11SP3_PPA_REPO_SOURCE" -u "$SLES_11SP3_PPA_REPO_SOURCE_ASIA" sles_11sp3_ppa_repo.tar.gz unzip /var/lib/cobbler/repo_mirror || exit $?
fi fi
sudo cobbler repo remove --name Ubuntu-14.04-x86_64
sudo cobbler reposync sudo cobbler reposync
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "cobbler reposync failed" echo "cobbler reposync failed"

View File

@ -71,6 +71,7 @@ if [ ! -f /usr/lib64/libcrypto.so ]; then
sudo cp -rf /usr/lib64/libcrypto.so.6 /usr/lib64/libcrypto.so sudo cp -rf /usr/lib64/libcrypto.so.6 /usr/lib64/libcrypto.so
fi fi
sudo mkdir -p /opt/compass/db
sudo chmod -R 777 /opt/compass/db sudo chmod -R 777 /opt/compass/db
sudo chmod -R 777 /var/log/compass sudo chmod -R 777 /var/log/compass
sudo chmod -R 777 /var/log/chef sudo chmod -R 777 /var/log/chef
@ -99,8 +100,8 @@ domains=$(echo $NAMESERVER_DOMAINS | sed "s/,/','/g")
sudo sed -i "s/\$domains/$domains/g" /etc/compass/setting sudo sed -i "s/\$domains/$domains/g" /etc/compass/setting
sudo sed -i "s/\$cobbler_ip/$IPADDR/g" /etc/compass/os_installer/cobbler.conf sudo sed -i "s/\$cobbler_ip/$IPADDR/g" /etc/compass/os_installer/cobbler.conf
sudo sed -i "s/\$chef_ip/$IPADDR/g" /etc/compass/package_installer/chef-icehouse.conf #sudo sed -i "s/\$chef_ip/$IPADDR/g" /etc/compass/package_installer/chef-icehouse.conf
sudo sed -i "s/\$chef_hostname/$HOSTNAME/g" /etc/compass/package_installer/chef-icehouse.conf #sudo sed -i "s/\$chef_hostname/$HOSTNAME/g" /etc/compass/package_installer/chef-icehouse.conf
sudo sed -i "s|\$PythonHome|$VIRTUAL_ENV|g" /opt/compass/bin/switch_virtualenv.py sudo sed -i "s|\$PythonHome|$VIRTUAL_ENV|g" /opt/compass/bin/switch_virtualenv.py
sudo ln -s -f $VIRTUAL_ENV/bin/celery /opt/compass/bin/celery sudo ln -s -f $VIRTUAL_ENV/bin/celery /opt/compass/bin/celery
@ -116,12 +117,12 @@ sudo chown -R redis:root /var/run/redis
sudo mkdir -p /var/lib/redis sudo mkdir -p /var/lib/redis
sudo chown -R redis:root /var/lib/redis sudo chown -R redis:root /var/lib/redis
sudo rm -rf /var/lib/redis/dump.rdb sudo rm -rf /var/lib/redis/dump.rdb
sudo killall -9 redis-server sudo systemctl kill redis-server
sudo rm -rf /var/run/redis/redis.pid sudo rm -rf /var/run/redis/redis.pid
sudo service redis restart sudo systemctl restart redis.service
sleep 10 sleep 10
echo "Checking if redis is running" echo "Checking if redis is running"
sudo service redis status sudo systemctl status redis.service
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
echo "redis is running" echo "redis is running"
else else
@ -130,8 +131,8 @@ else
exit 1 exit 1
fi fi
sudo chkconfig compass-progress-updated on sudo systemctl enable compass-progress-updated.service
sudo chkconfig compass-celeryd on sudo systemctl enable compass-celeryd.service
/opt/compass/bin/refresh.sh /opt/compass/bin/refresh.sh
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
@ -141,7 +142,7 @@ else
echo "compassed service is refreshed" echo "compassed service is refreshed"
fi fi
sudo service httpd status sudo systemctl status httpd.service
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "httpd is not started" echo "httpd is not started"
exit 1 exit 1
@ -149,7 +150,7 @@ else
echo "httpd has already started" echo "httpd has already started"
fi fi
sudo service redis status |grep running sudo systemctl status redis.service |grep running
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "redis is not started" echo "redis is not started"
exit 1 exit 1
@ -157,13 +158,13 @@ else
echo "redis has already started" echo "redis has already started"
fi fi
sudo service mysqld status |grep running sudo systemctl status mariadb.service |grep running
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "mysqld is not started" echo "mysqld is not started"
exit 1 exit 1
fi fi
sudo service compass-celeryd status |grep running sudo systemctl status compass-celeryd.service |grep running
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "compass-celeryd is not started" echo "compass-celeryd is not started"
exit 1 exit 1
@ -171,7 +172,7 @@ else
echo "compass-celeryd has already started" echo "compass-celeryd has already started"
fi fi
service compass-progress-updated status |grep running sudo systemctl status compass-progress-updated.service |grep running
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "compass-progress-updated is not started" echo "compass-progress-updated is not started"
exit 1 exit 1
@ -180,8 +181,8 @@ else
fi fi
sleep 10 sleep 10
compass check #compass check
if [[ "$?" != "0" ]]; then #if [[ "$?" != "0" ]]; then
echo "compass check failed" # echo "compass check failed"
exit 1 # exit 1
fi #fi

View File

@ -16,8 +16,11 @@ source $DIR/install_func.sh
mkdir -p /var/www/compass_web mkdir -p /var/www/compass_web
rm -rf /var/www/compass_web/* rm -rf /var/www/compass_web/*
sudo cp -rf $WEB_HOME/public/* /var/www/compass_web/ #sudo cp -rf $WEB_HOME/public/* /var/www/compass_web/
sudo cp -rf $WEB_HOME/v2 /var/www/compass_web/ #sudo cp -rf $WEB_HOME/v2 /var/www/compass_web/
sudo mkdir -p /var/www/compass_web/v2.5
sudo cp -rf $WEB_HOME/v2.5/target/* /var/www/compass_web/v2.5/
if [[ $LOCAL_REPO = "y" ]]; then if [[ $LOCAL_REPO = "y" ]]; then
echo "setting up local repo" echo "setting up local repo"
@ -49,11 +52,11 @@ if [[ $LOCAL_REPO = "y" ]]; then
fi fi
fi fi
sudo service httpd restart sudo systemctl restart httpd.service
sleep 10 sleep 10
echo "Checking if httpd is running" echo "Checking if httpd is running"
sudo service httpd status sudo systemctl status httpd.service
if [[ "$?" == "0" ]]; then if [[ "$?" == "0" ]]; then
echo "httpd is running" echo "httpd is running"
else else

View File

@ -10,7 +10,7 @@ if [ "$tempest" == "true" ]; then
exit 1 exit 1
fi fi
fi fi
sudo yum install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mysql mysql-server mysql-devel python-virtualenv python-setuptools python-pip bc libselinux-python sudo yum install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget syslinux amqp rabbitmq-server mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python unzip openssl openssl098e ca-certificates mariadb mariadb-server mysql-devel python-virtualenv python-setuptools python-pip bc libselinux-python
sudo yum --setopt=tsflags=noscripts -y remove redis sudo yum --setopt=tsflags=noscripts -y remove redis
sudo yum --enablerepo=remi,remi-test install -y redis sudo yum --enablerepo=remi,remi-test install -y redis
@ -30,10 +30,10 @@ if [[ "$?" != "0" ]]; then
exit 1 exit 1
fi fi
sudo pip install --upgrade setuptools
sudo pip install --upgrade virtualenv
sudo easy_install --upgrade pip sudo easy_install --upgrade pip
sudo pip install --upgrade pip sudo pip install --upgrade pip
sudo pip install --upgrade setuptools
sudo pip install --upgrade virtualenv
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "failed to install easy install" echo "failed to install easy install"
exit 1 exit 1
@ -45,18 +45,14 @@ if [[ "$?" != "0" ]]; then
exit 1 exit 1
fi fi
sudo chkconfig httpd on sudo systemctl enable httpd.service
sudo chkconfig squid on sudo systemctl enable squid.service
sudo chkconfig xinetd on sudo systemctl enable xinetd.service
sudo chkconfig dhcpd on sudo systemctl enable dhcpd.service
sudo chkconfig named on sudo systemctl enable named.service
sudo chkconfig sshd on sudo systemctl enable sshd.service
sudo chkconfig rsyslog on sudo systemctl enable rsyslog.service
sudo chkconfig ntpd on sudo systemctl enable ntpd.service
sudo chkconfig redis on sudo systemctl enable redis.service
sudo chkconfig mysqld on sudo systemctl enable mariadb.service
sudo chkconfig iptables off sudo systemctl disable firewalld
sudo chkconfig ip6tables off
if `sudo chkconfig --list dnsmasq`; then
sudo chkconfig dnsmasq off
fi

View File

@ -9,7 +9,8 @@ export PACKAGE_INSTALLER=${PACKAGE_INSTALLER:-package}
# set remi release url # set remi release url
# export ATOMIC=${ATOMIC:-http://www6.atomicorp.com/channels/atomic/${IMAGE_TYPE,,}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/RPMS/atomic-release-1.0-19.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.art.noarch.rpm} # export ATOMIC=${ATOMIC:-http://www6.atomicorp.com/channels/atomic/${IMAGE_TYPE,,}/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/RPMS/atomic-release-1.0-19.${IMAGE_TYPE_OTHER}${IMAGE_VERSION_MAJOR}.art.noarch.rpm}
export REMI=${REMI:-http://rpms.famillecollet.com/enterprise/remi-release-6.rpm} # export REMI=${REMI:-http://rpms.famillecollet.com/enterprise/remi-release-6.rpm}
export REMI=${REMI:-http://rpms.famillecollet.com/enterprise/remi-release-7.rpm}
# service NIC # service NIC
export NIC=${NIC:-} export NIC=${NIC:-}

View File

@ -64,12 +64,13 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $DIR/install.conf source $DIR/install.conf
### Change selinux security policy ### Change selinux security policy
echo 0 > /selinux/enforce sudo setenforce 0
sudo sed -i 's/enforcing/disabled/g' /etc/selinux/config
### Add epel repo ### Add epel repo
sudo rpm -q epel-release sudo rpm -q epel-release
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/epel-release-6-8.noarch.rpm >& /dev/null #sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/${IMAGE_VERSION_MAJOR}/${IMAGE_ARCH}/epel-release-6-8.noarch.rpm >& /dev/null
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
echo "failed to install epel-release" echo "failed to install epel-release"
exit 1 exit 1
@ -163,27 +164,29 @@ loadvars()
done done
fi fi
} }
yum -y install net-tools
loadvars NIC "eth0" loadvars NIC "eth0"
sudo ifconfig $NIC sudo ifconfig $NIC
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "There is no nic '$NIC' yet" echo "There is no nic '$NIC' yet"
exit 1 exit 1
fi fi
sudo ifconfig $NIC | grep 'inet addr:' >& /dev/null # sudo ifconfig $NIC | grep 'inet addr:' >& /dev/null
sudo ifconfig $NIC |grep 'inet '| cut -d ' ' -f10 >& /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "There is not any IP address assigned to the NIC '$NIC' yet, please assign an IP address first." echo "There is not any IP address assigned to the NIC '$NIC' yet, please assign an IP address first."
exit 1 exit 1
fi fi
export ipaddr=$(ifconfig $NIC | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') # export ipaddr=$(ifconfig $NIC | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
export ipaddr=$(ifconfig $NIC | grep 'inet ' | cut -d' ' -f10)
loadvars IPADDR ${ipaddr} loadvars IPADDR ${ipaddr}
ipcalc $IPADDR -c ipcalc $IPADDR -c
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ip addr $IPADDR format should be x.x.x.x" echo "ip addr $IPADDR format should be x.x.x.x"
exit 1 exit 1
fi fi
export netmask=$(ifconfig $NIC |grep Mask | cut -f 4 -d ':') export netmask=$(ifconfig $NIC | grep netmask | cut -d ' ' -f 13)
loadvars NETMASK ${netmask} loadvars NETMASK ${netmask}
export netaddr=$(ipcalc $IPADDR $NETMASK -n |cut -f 2 -d '=') export netaddr=$(ipcalc $IPADDR $NETMASK -n |cut -f 2 -d '=')
export netprefix=$(ipcalc $IPADDR $NETMASK -p |cut -f 2 -d '=') export netprefix=$(ipcalc $IPADDR $NETMASK -p |cut -f 2 -d '=')

View File

@ -53,11 +53,11 @@ sudo cp -rn /etc/ntp.conf /root/backup/
sudo rm -f /etc/ntp.conf sudo rm -f /etc/ntp.conf
sudo cp -rf $COMPASSDIR/misc/ntp/ntp.conf /etc/ntp.conf sudo cp -rf $COMPASSDIR/misc/ntp/ntp.conf /etc/ntp.conf
sudo chmod 644 /etc/ntp.conf sudo chmod 644 /etc/ntp.conf
sudo service ntpd stop sudo systemctl stop ntpd.service
sudo ntpdate 0.centos.pool.ntp.org sudo ntpdate 0.centos.pool.ntp.org
sudo service ntpd start sudo systemctl start ntpd.service
sudo sleep 10 sudo sleep 10
sudo service ntpd status sudo systemctl status ntpd.service
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "ntp is not started" echo "ntp is not started"
exit 1 exit 1
@ -65,37 +65,37 @@ else
echo "ntp conf is updated" echo "ntp conf is updated"
fi fi
# update squid conf # commenting out squid as we are not using it now
echo "update squid config" #echo "update squid config"
sudo cp -rn /etc/squid/squid.conf /root/backup/ #sudo cp -rn /etc/squid/squid.conf /root/backup/
sudo rm -f /etc/squid/squid.conf #sudo rm -f /etc/squid/squid.conf
sudo cp $COMPASSDIR/misc/squid/squid.conf /etc/squid/ #sudo cp $COMPASSDIR/misc/squid/squid.conf /etc/squid/
export netaddr=$(ipcalc $IPADDR $NETMASK -n |cut -f 2 -d '=') #export netaddr=$(ipcalc $IPADDR $NETMASK -n |cut -f 2 -d '=')
export netprefix=$(ipcalc $IPADDR $NETMASK -p |cut -f 2 -d '=') #export netprefix=$(ipcalc $IPADDR $NETMASK -p |cut -f 2 -d '=')
subnet=${netaddr}/${netprefix} #subnet=${netaddr}/${netprefix}
subnet_escaped=$(echo $subnet | sed -e 's/[\/&]/\\&/g') #subnet_escaped=$(echo $subnet | sed -e 's/[\/&]/\\&/g')
sudo sed -i "s/acl localnet src \$subnet/acl localnet src $subnet_escaped/g" /etc/squid/squid.conf #sudo sed -i "s/acl localnet src \$subnet/acl localnet src $subnet_escaped/g" /etc/squid/squid.conf
sudo chmod 644 /etc/squid/squid.conf #sudo chmod 644 /etc/squid/squid.conf
sudo mkdir -p /var/squid/cache #sudo mkdir -p /var/squid/cache
sudo chown -R squid:squid /var/squid #sudo chown -R squid:squid /var/squid
sudo mkdir -p /var/log/squid #sudo mkdir -p /var/log/squid
sudo chmod -R 777 /var/log/squid #sudo chmod -R 777 /var/log/squid
sudo service squid restart #sudo systemctl restart squid.service
sudo sleep 10 #sudo sleep 10
sudo service squid status #sudo ser
if [[ "$?" != "0" ]]; then #if [[ "$?" != "0" ]]; then
echo "squid is not started" # echo "squid is not started"
exit 1 # exit 1
else #else
echo "squid conf is updated" # echo "squid conf is updated"
fi # fi
mkdir -p /var/log/httpd mkdir -p /var/log/httpd
chmod -R 777 /var/log/httpd chmod -R 777 /var/log/httpd
sudo service httpd restart systemctl restart httpd.service
sudo sleep 10 sudo sleep 10
sudo service httpd status systemctl status httpd.service
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "httpd is not started" echo "httpd is not started"
exit 1 exit 1
@ -108,9 +108,9 @@ echo "update mysqld"
mkdir -p /var/log/mysql mkdir -p /var/log/mysql
chmod -R 777 /var/log/mysql chmod -R 777 /var/log/mysql
sleep 10 sleep 10
sudo service mysqld restart systemctl restart mariadb.service
sudo sleep 10 sudo sleep 10
sudo service mysqld status systemctl status mariadb.service
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "failed to restart mysqld" echo "failed to restart mysqld"
exit 1 exit 1
@ -144,9 +144,9 @@ if [[ "$?" != "0" ]]; then
else else
echo "mysql database set succeeded" echo "mysql database set succeeded"
fi fi
sudo service mysqld restart sudo systemctl restart mariadb.service
sudo sleep 10 sudo sleep 10
sudo service mysqld status sudo systemctl status mariadb.service
if [[ "$?" != "0" ]]; then if [[ "$?" != "0" ]]; then
echo "mysqld is not started" echo "mysqld is not started"
exit 1 exit 1
@ -243,6 +243,7 @@ else
deactivate deactivate
fi fi
# download cobbler related packages # download cobbler related packages
if [[ $SUPPORT_CENTOS_6_5 == "y" ]]; then if [[ $SUPPORT_CENTOS_6_5 == "y" ]]; then
download -u $CENTOS_6_5_PPA_REPO_SOURCE -u $CENTOS_6_5_PPA_REPO_SOURCE_ASIA || exit $? download -u $CENTOS_6_5_PPA_REPO_SOURCE -u $CENTOS_6_5_PPA_REPO_SOURCE_ASIA || exit $?

View File

@ -8,9 +8,9 @@ WSGIScriptAlias /api /var/www/compass/compass.wsgi
WSGISocketPrefix /var/run/wsgi WSGISocketPrefix /var/run/wsgi
<VirtualHost *:80> <VirtualHost *:80>
DocumentRoot /var/www/compass_web/v2 DocumentRoot /var/www/compass_web/v2.5
<Directory "/var/www/compass_web/v2"> <Directory "/var/www/compass_web/v2.5">
Options Indexes FollowSymLinks Options Indexes FollowSymLinks
Order allow,deny Order allow,deny
Allow from all Allow from all

View File

@ -39,7 +39,6 @@ SSLSessionCacheTimeout 300
# Semaphore: # Semaphore:
# Configure the path to the mutual exclusion semaphore the # Configure the path to the mutual exclusion semaphore the
# SSL engine uses internally for inter-process synchronization. # SSL engine uses internally for inter-process synchronization.
SSLMutex default
# Pseudo Random Number Generator (PRNG): # Pseudo Random Number Generator (PRNG):
# Configure one or more sources to seed the PRNG of the # Configure one or more sources to seed the PRNG of the

14
misc/rsync Normal file
View File

@ -0,0 +1,14 @@
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = no
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}