From d9dfbd1a2944c0b69cab40a15516da7150531c3c Mon Sep 17 00:00:00 2001 From: slerena Date: Tue, 22 Sep 2009 10:38:53 +0000 Subject: [PATCH] 2009-09-22 Sancho Lerena * pandora_server_installer: Fixes some problems detecting Linux (was skipping tentacle installation). * util/tentacle_serverd: Fixed some problems starting tentacle because short timeout after starting and because the unquoted grep. * util/pandora_server: Incresed sleep time on start. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1965 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 10 ++++++++ pandora_server/pandora_server_installer | 32 ++++++++++++++++--------- pandora_server/util/pandora_server | 2 +- pandora_server/util/tentacle_serverd | 5 ++-- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 72f0637c7d..b55dd9c50c 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,13 @@ +2009-09-22 Sancho Lerena + + * pandora_server_installer: Fixes some problems detecting Linux + (was skipping tentacle installation). + + * util/tentacle_serverd: Fixed some problems starting tentacle + because short timeout after starting and because the unquoted grep. + + * util/pandora_server: Incresed sleep time on start. + 2009-09-21 Evi Vanoost * pandora_server_installer: Fixed a few bugs on non-Linux platforms diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7d9d902a34..af54177474 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -14,7 +14,7 @@ SECOPT=$2 get_distro () { # Get Linux Distro type and version # We assume we are on Linux unless told otherwise - LINUX=TRUE + LINUX=YES if [ -f "/etc/SuSE-release" ] then OS_VERSION=`cat /etc/SuSE-release | grep VERSION | cut -f 3 -d " "` @@ -39,13 +39,19 @@ get_distro () { # For future reference, Darwin doesn't have /etc/init.d but uses LaunchDaemons LINUX_DISTRO="Darwin" OS_VERSION=`uname -r` - LINUX=FALSE + LINUX=NO + elif [ `uname -s` == "AIX" ] + then + # For future reference, AIX doesn't have /etc/init.d + LINUX_DISTRO="AIX" + OS_VERSION=`uname -r` + LINUX=NO elif [ `uname -s` == "SunOS" ] then # Some Solaris and other Unices don't have /etc/init.d, some have /usr/spool instead of /var/spool LINUX_DISTRO="Solaris" OS_VERSION=`uname -r` - LINUX=FALSE + LINUX=NO elif [ `uname -s` == "Linux" ] then # Test for Linux to make sure we're on Linux @@ -55,9 +61,9 @@ get_distro () { # Default to Linux is false, test for real Linux above - that way we don't assume we can just plunk down files everywhere LINUX_DISTRO=`uname -s` OS_VERSION=`uname -r` - LINUX=FALSE + LINUX=NO fi - echo $LINUX_DISTRO + echo "$LINUX_DISTRO:$OS_VERSION:$LINUX" } @@ -85,9 +91,13 @@ install () { echo " " rm output else + + # This returns a multiple value string, separated with ":" -> $LINUX_DISTRO:$OS_VERSION:$LINUX + GET_DISTRO="`get_distro`" + DISTRO=`echo $GET_DISTRO | cut -f 1 -d ":"` + OS_VERSION=`echo $GET_DISTRO | cut -f 2 -d ":"` + LINUX=`echo $GET_DISTRO | cut -f 3 -d ":"` - DISTRO=`get_distro` - if [ "$DISTRO" == "UBUNTU" ] then echo "UBUNTU distribution detected" @@ -160,7 +170,7 @@ install () { cp conf/pandora_server.conf /etc/pandora/ chmod 770 /etc/pandora/pandora_server.conf - if [ "$LINUX" == TRUE ] + if [ "$LINUX" == "YES" ] then echo "Copying the daemon script into /etc/init.d/pandora_server" cp util/pandora_server /etc/init.d/ @@ -182,8 +192,8 @@ install () { else echo "Please add a log rotation schedule manually to your log rotation daemon (if any)" fi - - if [ "$LINUX" == TRUE ] + + if [ "$LINUX" == "YES" ] then if [ "$SECOPT" != "--no-tentacle" ] then @@ -227,7 +237,7 @@ uninstall () { echo "This is not a Linux-based distro. Uninstaller is currently not working for your OS" fi echo "Removing Pandora Servers" - rm -Rf /var/spool/pandora/data_in/ + rm -Rf /var/spool/pandora/data_in/ echo "If the user Pandora is not being used for any other operations, please delete using the following commands:" echo " userdel pandora" diff --git a/pandora_server/util/pandora_server b/pandora_server/util/pandora_server index 9fbb680f0b..478d6bd560 100755 --- a/pandora_server/util/pandora_server +++ b/pandora_server/util/pandora_server @@ -57,7 +57,7 @@ case "$1" in fi $PANDORA_DAEMON $PANDORA_HOME -D - sleep 2 + sleep 4 PANDORA_PID=`pidof_pandora` if [ ! -z "$PANDORA_PID" ] diff --git a/pandora_server/util/tentacle_serverd b/pandora_server/util/tentacle_serverd index 475422c1dc..66cd4d1bb6 100755 --- a/pandora_server/util/tentacle_serverd +++ b/pandora_server/util/tentacle_serverd @@ -40,7 +40,7 @@ umask 0007 # if not running). Can be a list of PIDs if multiple instances are running. function get_pid { - TENTACLE_PID=`ps aux | grep $TENTACLE_PATH$TENTACLE_DAEMON | grep -v grep | tail -1 | awk '{ print $2 }'` + TENTACLE_PID=`ps aux | grep "$TENTACLE_PATH$TENTACLE_DAEMON" | grep -v grep | tail -1 | awk '{ print $2 }'` echo $TENTACLE_PID } @@ -70,8 +70,7 @@ case "$1" in fi sudo -u $TENTACLE_USER ${TENTACLE_PATH}$TENTACLE_DAEMON $TENTACLE_OPTS - sleep 1 - + sleep 4 TENTACLE_PID=`get_pid` if [ ! -z "$TENTACLE_PID" ]; then echo "Tentacle server is now running with PID $TENTACLE_PID."