Merge "Fix apache2 error"
This commit is contained in:
commit
f8df591df5
@ -36,6 +36,23 @@ function check_dashboard_settings {
|
||||
echo "Checking dashboard configuration."
|
||||
check_dashboard_settings
|
||||
|
||||
function check_apache_service {
|
||||
# Check if apache service is down, if not force retry a couple of times.
|
||||
sleep 10
|
||||
i=0
|
||||
until service apache2 status | grep 'not running'; do
|
||||
sudo service apache2 stop
|
||||
sleep 10
|
||||
i ++
|
||||
if [ $i -gt 3 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
echo "Reloading apache and memcached service."
|
||||
sudo service apache2 restart
|
||||
sudo service apache2 stop
|
||||
check_apache_service
|
||||
sudo service apache2 start
|
||||
sudo service memcached restart
|
||||
|
@ -50,9 +50,20 @@ function ubuntu_cloud_archive {
|
||||
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||
}
|
||||
|
||||
function apache_fix {
|
||||
|
||||
# On '$service apache2 restart', apache will use a text browser to check
|
||||
# connectivity on '127.0.0.1' or 'localhost'. Apache needs www-browser
|
||||
# (/etc/alternatives/www-browser) virtual package to carry out this check.
|
||||
# Include a basic text browser to preemptively avoid this error.
|
||||
sudo apt-get -y install w3m
|
||||
|
||||
}
|
||||
|
||||
# precise needs the cloud archive, and so does trusty for non-Icehouse releases
|
||||
if grep -qs DISTRIB_CODENAME=precise /etc/lsb-release ||
|
||||
[ "$OPENSTACK_RELEASE" != "icehouse" ]; then
|
||||
echo "Enabling the Ubuntu cloud archive."
|
||||
ubuntu_cloud_archive
|
||||
apache_fix
|
||||
fi
|
||||
|
@ -53,6 +53,22 @@ function check_dashboard_settings {
|
||||
echo "Checking dashboard configuration."
|
||||
check_dashboard_settings
|
||||
|
||||
function check_apache_service {
|
||||
# Check if apache service is down, if not force retry a couple of times.
|
||||
sleep 10
|
||||
i=0
|
||||
until service apache2 status | grep 'not running'; do
|
||||
sudo service apache2 stop
|
||||
sleep 10
|
||||
i ++
|
||||
if [ $i -gt 3]
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
echo "Reloading apache and memcached service."
|
||||
sudo service apache2 restart
|
||||
sudo service apache2 stop
|
||||
check_apache_service
|
||||
sudo service memcached restart
|
||||
|
Loading…
x
Reference in New Issue
Block a user