From 755e8eb7d663bd4f0f8a173c2d158fec88b8298b Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Tue, 27 Nov 2012 12:52:31 -0800 Subject: [PATCH] Fix the RHEL install script, mostly for RHEL 5. Summary: A bunch of various fixes for the RHEL install script. Most of them are stylistic, one of them fixes the EPEL repo release RPM URL for RHEL 5. (enough acronyms there?) Test Plan: Tried installing on Fedora (which is treated as RHEL 6 due to how we handle being unable to find version in the script). Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4038 --- scripts/install/install_rhel-derivs.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/install/install_rhel-derivs.sh b/scripts/install/install_rhel-derivs.sh index f6b6c05322..e0669de7f6 100755 --- a/scripts/install/install_rhel-derivs.sh +++ b/scripts/install/install_rhel-derivs.sh @@ -33,7 +33,7 @@ else confirm fi -if [[ $RHEL_MAJOR_VER < 6 ]] +if [[ $RHEL_MAJOR_VER < 6 && $RHEL_MAJOR_VER > 0 ]] then echo "** WARNING **" echo "A major version less than 6 was detected. Because of this," @@ -63,8 +63,12 @@ if [[ $RHEL_MAJOR_VER == 5 ]] then # RHEL 5's "php" package is actually 5.1. The "php53" package won't let us install php-pecl-apc. # (it tries to pull in php 5.1 stuff) ... - echo "Adding EPEL repo, for git." - $SUDO rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm + yum repolist | grep -i epel + if [ $? -ne 0 ]; then + echo "It doesn't look like you have the EPEL repo enabled. We are to add it" + echo "for you, so that we can install git." + $SUDO rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm + fi YUMCOMMAND="$SUDO yum install httpd git php53 php53-cli php53-mysql php53-process php53-devel php53-gd gcc wget make pcre-devel mysql-server" else # RHEL 6+ defaults with php 5.3 @@ -89,7 +93,6 @@ then # set up PEAR, and install apc. echo "Attempting to install PEAR" wget http://pear.php.net/go-pear.phar - echo "Downloading PEAR: $PEARCOMMAND" $SUDO php go-pear.phar && $SUDO pecl install apc fi @@ -98,14 +101,16 @@ then echo "The apc install failed. Continuing without APC, performance may be impacted." fi -if [[ "$(pidof httpd)" ]] +pidof httpd 2>&1 > /dev/null +if [[ $? -eq 0 ]] then echo "If php was installed above, please run: /etc/init.d/httpd graceful" else echo "Please remember to start the httpd with: /etc/init.d/httpd start" fi -if [[ ! "$(pidof mysql)" ]] +pidof mysqld 2>&1 > /dev/null +if [[ $? -ne 0 ]] then echo "Please remember to start the mysql server: /etc/init.d/mysqld start" fi @@ -139,4 +144,4 @@ echo echo echo "Install probably worked mostly correctly. Continue with the 'Configuration Guide':"; echo -echo " http://www.phabricator.com/docs/phabricator/article/Configuration_Guide.html"; \ No newline at end of file +echo " http://www.phabricator.com/docs/phabricator/article/Configuration_Guide.html";