Skip to content

Commit 33cfad5

Browse files
author
Kamil Izdebski
committed
Updates for openrc specific service run. Check few packages before try
to install it.
1 parent dfd9f66 commit 33cfad5

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

functions

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,10 @@ function restart_service() {
628628
fi
629629
if [[ "$os_PACKAGE" = "deb" ]]; then
630630
sudo /usr/sbin/service $1 restart
631-
else
631+
elif [[ "$os_PACKAGE" = "rpm" ]]; then
632632
sudo /sbin/service $1 restart
633+
elif [[ "$os_PACKAGE" = "ebuild" ]]; then
634+
sudo rc-service $1 restart
633635
fi
634636
}
635637

stack.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -746,14 +746,14 @@ elif [[ "$os_PACKAGE" = "ebuild" ]]; then
746746
fi
747747

748748
if [[ $SYSLOG != "False" ]]; then
749-
install_package rsyslog-relp
749+
is_package_installed rsyslog-relp || install_package rsyslog-relp
750750
fi
751751

752752
if is_service_enabled rabbit; then
753753
# Install rabbitmq-server
754754
# the temp file is necessary due to LP: #878600
755755
tfile=$(mktemp)
756-
install_package rabbitmq-server > "$tfile" 2>&1
756+
is_package_installed || install_package rabbitmq-server > "$tfile" 2>&1
757757
cat "$tfile"
758758
rm -f "$tfile"
759759
elif is_service_enabled qpid; then
@@ -768,7 +768,7 @@ elif is_service_enabled zeromq; then
768768
elif [[ "$os_PACKAGE" = "deb" ]]; then
769769
install_package libzmq1 python-zmq
770770
elif [[ "$os_PACKAGE" = "ebuild" ]]; then
771-
install_package zeromq pyzmq
771+
is_package_installed zeromq pyzmq || install_package zeromq pyzmq
772772
fi
773773
fi
774774

@@ -798,7 +798,7 @@ EOF
798798
fi
799799
# Install mysql-server
800800
if [[ "$os_PACKAGE" = "ebuild" ]]; then
801-
install_package mysql
801+
is_package_installed mysql || install_package mysql
802802
else
803803
install_package mysql-server
804804
fi
@@ -812,7 +812,7 @@ if is_service_enabled horizon; then
812812
sudo rm -f /etc/httpd/conf.d/000-*
813813
install_package httpd mod_wsgi
814814
elif [[ "$os_PACKAGE" = "ebuild" ]]; then
815-
install_package apache mod_wsgi
815+
is_package_installed apache mod_wsgi || install_package apache mod_wsgi
816816
fi
817817
fi
818818

@@ -844,7 +844,7 @@ TRACK_DEPENDS=${TRACK_DEPENDS:-False}
844844
# Install python packages into a virtualenv so that we can track them
845845
if [[ $TRACK_DEPENDS = True ]] ; then
846846
echo_summary "Installing Python packages into a virtualenv $DEST/.venv"
847-
install_package python-virtualenv
847+
is_package_installed python-virtualenv || install_package python-virtualenv
848848

849849
rm -rf $DEST/.venv
850850
virtualenv --system-site-packages $DEST/.venv
@@ -1180,8 +1180,10 @@ if is_service_enabled horizon; then
11801180
APACHE_NAME=apache2
11811181
APACHE_CONF=vhosts.d/horizon.conf
11821182
# Disable default config
1183-
sudo rm -f /etc/apache2/vhosts.d/*default_*vhost.*
11841183
sudo touch /etc/$APACHE_NAME/$APACHE_CONF
1184+
#Enable WSGI if not already enabled
1185+
grep -E "APACHE2_OPTS.*-D WSGI" /etc/conf.d/apache2 ||
1186+
sudo sed 's/APACHE2_OPTS=\"/APACHE2_OPTS=\"-D WSGI /' -i /etc/conf.d/apache2
11851187
fi
11861188

11871189
# Configure apache to run horizon

0 commit comments

Comments
 (0)