Install Compass in virtual env

Create virtualenv for compass, point compass site packages to virtualenv,
make virtualenv accessable for apache.
Change compass executable scripts to use python in env to be virtualenv
compatible.
Make progress_update daemon use virtualenv.
Comment out some health checks that use packages not available to pip, eg,
yum, apt since we have other ways to check packages any way.

Conflicts:

	conf/compassd
	install/compass.sh
	install/dependency.sh
	install/prepare.sh
	misc/apache/compass.wsgi
	requirements.txt

Change-Id: Ib48633601bf238ffc660c4694834897edbe45e07
This commit is contained in:
zhaoxinyu 2014-07-23 18:39:21 -07:00
parent 0e607e4563
commit a044f9f3c5
20 changed files with 214 additions and 76 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Huawei Technologies Co. Ltd
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import sys
import compass.actions.cli as cli

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Huawei Technologies Co. Ltd
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Huawei Technologies Co. Ltd
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Huawei Technologies Co. Ltd
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Huawei Technologies Co. Ltd
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Huawei Technologies Co. Ltd
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
#
# Copyright 2014 Huawei Technologies Co. Ltd
#

View File

@ -36,12 +36,12 @@ class BootCheck(base.BaseCheck):
status['celery'] = self._check_celery()
status['dhcp'] = self._check_dhcp()
status['dns'] = self._check_dns()
status['hds'] = self._check_hds()
# status['hds'] = self._check_hds()
status['os_installer'] = self._check_os_installer()
status['package_installer'] = self._check_package_installer()
status['squid'] = self._check_squid()
status['tftp'] = self._check_tftp()
status['other'] = self._check_misc()
# status['other'] = self._check_misc()
return status

View File

@ -18,6 +18,7 @@ sudo mkdir -p /root/backup/cobbler
# update httpd conf
sudo cp -rn /etc/httpd/conf.d /root/backup/cobbler/
sudo rm -f /etc/httpd/conf.d/cobbler_web.conf
sudo rm -f /etc/httpd/conf.d/ods-server.conf
sudo cp -rf $COMPASSDIR/misc/apache/cobbler_web.conf /etc/httpd/conf.d/cobbler_web.conf
chmod 644 /etc/httpd/conf.d/cobbler_web.conf
sudo rm -rf /etc/httpd/conf.d/ssl.conf

View File

@ -9,18 +9,20 @@ mkdir -p /var/www/compass
sudo cp -rf $COMPASSDIR/misc/apache/ods-server /etc/httpd/conf.d/ods-server.conf
sudo cp -rf $COMPASSDIR/misc/apache/compass.wsgi /var/www/compass/compass.wsgi
sudo cp -rf $COMPASSDIR/conf/celeryconfig /etc/compass/
sudo cp -rf $COMPASSDIR/conf/global_config /etc/compass/
sudo cp -rf $COMPASSDIR/conf/setting /etc/compass/
sudo cp -rf $COMPASSDIR/conf/compassd /etc/init.d/
sudo cp -rf $COMPASSDIR/conf/* /etc/compass/
sudo cp -rf $COMPASSDIR/service/* /etc/init.d/
sudo cp -rf $COMPASSDIR/bin/*.py /opt/compass/bin/
sudo cp -rf $COMPASSDIR/bin/*.sh /opt/compass/bin/
sudo cp -rf $COMPASSDIR/bin/compass /usr/bin/
sudo cp -rf $COMPASSDIR/bin/chef/* /opt/compass/bin/
sudo cp -rf $COMPASSDIR/conf/compassd /usr/bin/
sudo cp -rf $WEB_HOME/public/* /var/www/compass_web/
sudo chkconfig compassd on
if [[ -f /etc/compass/package_installer/chef-icehouse.conf ]]; then
sudo sed -i "s/127.0.0.1/$ippaddr/g" /etc/compass/package_installer/chef-icehouse.conf
fi
# add apache user to the group of virtualenv user
sudo usermod -a -G `groups $USER|awk '{print$3}'` apache
sudo chkconfig compass-progress-updated on
sudo chkconfig compass-celeryd on
# setup ods server
if [ ! -f /usr/lib64/libcrypto.so ]; then
@ -32,12 +34,14 @@ sudo chmod -R 777 /var/log/compass
sudo echo "export C_FORCE_ROOT=1" > /etc/profile.d/celery_env.sh
sudo chmod +x /etc/profile.d/celery_env.sh
cd $COMPASSDIR
sudo python setup.py install
workon compass-core
python setup.py install
if [[ "$?" != "0" ]]; then
echo "failed to install compass package"
deactivate
exit 1
else
echo "compass package is installed"
echo "compass package is installed in virtualenv under current dir"
fi
sudo sed -i "/COBBLER_INSTALLER_URL/c\COBBLER_INSTALLER_URL = 'http:\/\/$ipaddr/cobbler_api'" /etc/compass/setting
@ -45,27 +49,31 @@ sudo sed -i "/CHEF_INSTALLER_URL/c\CHEF_INSTALLER_URL = 'https:\/\/$ipaddr/'" /e
sudo sed -i "s/\$compass_ip/$ipaddr/g" /etc/compass/global_config
sudo sed -i "s/\$compass_hostname/$HOSTNAME/g" /etc/compass/global_config
sudo sed -i "s/\$compass_testmode/$TESTMODE/g" /etc/compass/global_config
sudo sed -e 's|$PythonHome|'$VIRTUAL_ENV'|' -i /var/www/compass/compass.wsgi
sudo sed -e 's|$Python|'$VIRTUAL_ENV/bin/python'|' -i /etc/init.d/compass-progress-updated
sudo sed -e 's|$CeleryPath|'$VIRTUAL_ENV/bin/celeryd'|' -i /etc/init.d/compass-celeryd
sudo sed -e 's|$Python|'$VIRTUAL_ENV/bin/python'|' -i /usr/bin/compassd
# add cookbooks, databags and roles
sudo chmod +x /opt/compass/bin/addcookbooks.py
sudo chmod +x /opt/compass/bin/adddatabags.py
sudo chmod +x /opt/compass/bin/addroles.py
sudo /opt/compass/bin/addcookbooks.py
/opt/compass/bin/addcookbooks.py
if [[ "$?" != "0" ]]; then
echo "failed to add cookbooks"
exit 1
else
echo "cookbooks are added to chef server"
fi
sudo /opt/compass/bin/adddatabags.py
/opt/compass/bin/adddatabags.py
if [[ "$?" != "0" ]]; then
echo "failed to add databags"
exit 1
else
echo "databags are added to chef server"
fi
sudo /opt/compass/bin/addroles.py
/opt/compass/bin/addroles.py
if [[ "$?" != "0" ]]; then
echo "failed to add roles"
exit 1
@ -73,7 +81,23 @@ else
echo "roles are added to chef server"
fi
sudo /opt/compass/bin/refresh.sh
sudo mkdir -p /var/log/redis
sudo chown -R redis:root /var/log/redis
sudo mkdir -p /var/lib/redis/
sudo chown -R redis:root /var/lib/redis
sudo mkdir -p /var/run/redis
sudo chown -R redis:root /var/run/redis
sudo service redis restart
echo "Checking if redis is running"
sudo service redis status
if [[ "$?" == "0" ]]; then
echo "redis is running"
else
echo "redis is not running"
exit 1
fi
/opt/compass/bin/refresh.sh
if [[ "$?" != "0" ]]; then
echo "failed to refresh compassd service"
exit 1
@ -96,7 +120,7 @@ chown -R redis:root /var/lib/redis
mkdir -p /var/run/redis
chown -R redis:root /var/run/redis
sudo service redis status
sudo service redis status |grep running
if [[ "$?" != "0" ]]; then
echo "redis is not started"
exit 1
@ -104,16 +128,31 @@ else
echo "redis has already started"
fi
sudo service compassd status
sudo service mysqld status |grep running
if [[ "$?" != "0" ]]; then
echo "compassd is not started"
echo "mysqld is not started"
exit 1
else
echo "compassd has already started"
fi
sudo compass check
service compass-celeryd status |grep running
if [[ "$?" != "0" ]]; then
echo "compass check failed"
echo "compass-celeryd is not started"
exit 1
else
echo "compass-celeryd has already started"
fi
service compass-progress-updated status |grep running
if [[ "$?" != "0" ]]; then
echo "compass-progress-updated is not started"
exit 1
else
echo "compass-progress-updated has already started"
fi
#compass check
#if [[ "$?" != "0" ]]; then
# echo "compass check failed"
# exit 1
#fi
deactivate

View File

@ -10,7 +10,7 @@ if [ "$tempest" == "true" ]; then
exit 1
fi
fi
sudo yum install -y rsyslog logrotate ntp iproute openssh-clients python python-devel git wget python-setuptools syslinux python-netaddr python-flask python-flask-sqlalchemy python-amqplib python-argparse amqp python-paramiko python-mock mod_wsgi httpd squid dhcp bind rsync yum-utils xinetd tftp-server gcc net-snmp-utils net-snmp net-snmp-python python-daemon unzip openssl openssl098e ca-certificates redis python-redis --skip-broken
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 python-daemon unzip openssl openssl098e ca-certificates redis mysql mysql-server mysql-devel python-virtualenv
if [[ "$?" != "0" ]]; then
echo "failed to install yum dependency"
exit 1
@ -32,27 +32,7 @@ if [[ "$?" != "0" ]]; then
exit 1
fi
# pip install flask-sqlalchemy need to remove /usr/lib64/python2.6/site-packages/easy-install.pth
cp -n /usr/lib/python2.6/site-packages/easy-install* /usr/lib64/python2.6/site-packages/
if [ "$tempest" == "true" ]; then
sudo pip install -U setuptools
if [[ "$?" != "0" ]]; then
echo "failed to install setuptools"
exit 1
fi
fi
sudo pip install -U -r $COMPASSDIR/requirements.txt
if [[ "$?" != "0" ]]; then
echo "failed to install compass requirement packages"
exit 1
fi
sudo pip install -U -r $COMPASSDIR/test-requirements.txt
if [[ "$?" != "0" ]]; then
echo "failed to install compass test require packages"
exit 1
fi
sudo pip install virtualenvwrapper
sudo chkconfig httpd on
sudo chkconfig squid on

View File

@ -24,6 +24,12 @@ copy2dir()
cd $destdir
git remote set-url origin $repo
git remote update
if [ $? -ne 0 ]; then
echo "failed to git remote update $repo in $destdir"
exit 1
else
echo "git remote update $repo in $destdir succeeded"
fi
git reset --hard
git clean -x -f
git checkout $git_branch
@ -45,11 +51,19 @@ copy2dir()
if [[ ! -z $ZUUL_REF ]]; then
git_repo=$ZUUL_URL/$3
git_ref=$ZUUL_REF
git_branch=$ZUUL_BRANCH
if git branch -a|grep ${ZUUL_BRANCH}; then
git_branch=$ZUUL_BRANCH
else
git_branch=master
fi
elif [[ ! -z $GERRIT_REFSPEC ]]; then
git_repo=https://$GERRIT_HOST/$3
git_ref=$GERRIT_REFSPEC
git_branch=$GERRIT_BRANCH
if git branch -a|grep $GERRIT_BRANCH; then
git_branch=$GERRIT_BRANCH
else
git_branch=master
fi
fi
git reset --hard remotes/origin/$git_branch
git fetch $git_repo $git_ref && git checkout FETCH_HEAD
@ -141,18 +155,53 @@ else
echo "squid conf is updated"
fi
#update mysqld
sudo service mysqld restart
MYSQL_USER=${MYSQL_USER:-root}
MYSQL_OLD_PASSWORD=${MYSQL_OLD_PASSWORD:-}
MYSQL_PASSWORD=${MYSQL_PASSWORD:-root}
MYSQL_SERVER=${MYSQL_SERVER:-127.0.0.1}
MYSQL_PORT=${MYSQL_PORT:-3306}
MYSQL_DATABASE=${MYSQL_DATABASE:-db}
# first time set mysql password
sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} password ${MYSQL_PASSWORD}
sudo mysqladmin -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u ${MYSQL_USER} -p"${MYSQL_OLD_PASSWORD}" password ${MYSQL_PASSWORD}
mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "show databases;"
if [[ "$?" != "0" ]]; then
echo "mysql password set failed"
exit 1
else
echo "mysql password set successful"
fi
sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "drop database ${MYSQL_DATABASE}"
sudo mysql -h${MYSQL_SERVER} --port=${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} -e "create database ${MYSQL_DATABASE}"
if [[ "$?" != "0" ]]; then
echo "mysql database set fails"
exit 1
else
echo "mysql database set succeeds"
fi
sudo service mysqld restart
sudo service mysqld status
if [[ "$?" != "0" ]]; then
echo "mysqld is not started"
exit 1
else
echo "mysqld conf is updated"
fi
cd $SCRIPT_DIR
if [ -z $WEB_SOURCE ]; then
echo "web source $WEB_SOURCE is not set"
exit 1
fi
copy2dir "$WEB_SOURCE" "$WEB_HOME" "stackforge/compass-web"
copy2dir "$WEB_SOURCE" "$WEB_HOME" "stackforge/compass-web" || exit $?
if [ -z $ADAPTERS_SOURCE ]; then
echo "adpaters source $ADAPTERS_SOURCE is not set"
exit 1
fi
copy2dir "$ADAPTERS_SOURCE" "$ADAPTERS_HOME" "stackforge/compass-adapters"
copy2dir "$ADAPTERS_SOURCE" "$ADAPTERS_HOME" "stackforge/compass-adapters" || exit $?
if [ "$tempest" == "true" ]; then
if [[ ! -e /tmp/tempest ]]; then
@ -160,6 +209,8 @@ if [ "$tempest" == "true" ]; then
if [[ "$?" != "0" ]]; then
echo "failed to git clone tempest project"
exit 1
else
echo "git clone tempest project succeeded"
fi
cd /tmp/tempest
git checkout grizzly-eol
@ -167,12 +218,54 @@ if [ "$tempest" == "true" ]; then
cd /tmp/tempest
git remote set-url origin http://git.openstack.org/openstack/tempest
git remote update
if [[ "$?" != "0" ]]; then
echo "failed to git remote update tempest project"
exit 1
else
echo "git remote update tempest project succeeded"
fi
git reset --hard
git clean -x -f -d -q
git checkout grizzly-eol
fi
source `which virtualenvwrapper.sh`
if ! lsvirtualenv |grep tempest>/dev/null; then
mkvirtualenv tempest
fi
workon tempest
cd /tmp/tempest
pip install -e .
pip install sqlalchemy
if [[ "$?" != "0" ]]; then
echo "failed to install tempest project"
deactivate
exit 1
else
echo "install tempest project succeeded"
deactivate
fi
fi
source `which virtualenvwrapper.sh`
if ! lsvirtualenv |grep compass-core>/dev/null; then
mkvirtualenv compass-core
fi
workon compass-core
cd $COMPASSDIR
pip install -U -r requirements.txt
if [[ "$?" != "0" ]]; then
echo "failed to install compass requiremnts"
deactivate
exit 1
fi
pip install -U -r test-requirements.txt
if [[ "$?" != "0" ]]; then
echo "failed to install compass test requiremnts"
deactivate
exit 1
else
echo "intall compass requirements succeeded"
deactivate
fi
download()
@ -185,13 +278,13 @@ download()
else
if [[ "$url" =~ (http|https|ftp):// ]]; then
echo "downloading $url to /tmp/${package}"
wget -c --progress=bar:force -O /tmp/${package}.tmp $url
curl -L -o /tmp/${package}.tmp $url
if [[ "$?" != "0" ]]; then
echo "failed to download $package"
exit 1
else
echo "successfully download $package"
cp -rf /tmp/${package}.tmp /tmp/${package}
mv -f /tmp/${package}.tmp /tmp/${package}
fi
else
cp -rf $url /tmp/${package}
@ -239,7 +332,7 @@ wget-1.12-1.8.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENTOS_I
ntpdate-4.2.6p5-1.${CENTOS_IMAGE_TYPE_OTHER}${CENTOS_IMAGE_VERSION_MAJOR}.${CENTOS_IMAGE_TYPE,,}.${CENTOS_IMAGE_ARCH}.rpm"
for f in $centos_ppa_repo_packages; do
download ftp://rpmfind.net/linux/${IMAGE_TYPE,,}/${IMAGE_VERSION_MAJOR}/os/${IMAGE_ARCH}/Packages/$f $f || exit $?
download http://rpmfind.net/linux/${IMAGE_TYPE,,}/${IMAGE_VERSION_MAJOR}/os/${IMAGE_ARCH}/Packages/$f $f || exit $?
done
centos_ppa_repo_rsyslog_packages="
@ -265,16 +358,24 @@ download "$CENTOS_IMAGE_SOURCE" ${CENTOS_IMAGE_NAME}-${CENTOS_IMAGE_ARCH}.iso ||
download "$UBUNTU_IMAGE_SOURCE" ${UBUNTU_IMAGE_NAME}-${UBUNTU_IMAGE_ARCH}.iso || exit $?
# Install net-snmp
sudo cp -rn /etc/snmp/snmp.conf /root/backup/
if [[ ! -e /etc/snmp ]]; then
sudo mkdir -p /etc/snmp
fi
if [[ -e /etc/snmp/snmp.conf ]]; then
sudo cp -rn /etc/snmp/snmp.conf /root/backup/
sudo rm -f /etc/snmp/snmp.conf
fi
sudo mkdir -p /usr/local/share/snmp/
sudo cp -rf $COMPASSDIR/mibs /usr/local/share/snmp/
sudo rm -f /etc/snmp/snmp.conf
sudo cp -rf $COMPASSDIR/misc/snmp/snmp.conf /etc/snmp/snmp.conf
sudo chmod 644 /etc/snmp/snmp.conf
sudo mkdir -p /var/lib/net-snmp/mib_indexes
sudo chmod 755 /var/lib/net-snmp/mib_indexes
# generate ssh key
if [[ ! -e $HOME/.ssh ]]; then
sudo mkdir -p $HOME/.ssh
fi
if [ ! -e $HOME/.ssh/id_rsa.pub ]; then
rm -rf $HOME/.ssh/id_rsa
ssh-keygen -t rsa -f $HOME/.ssh/id_rsa -q -N ''

View File

@ -1,4 +1,12 @@
#!/usr/bin/env python
import site
import sys
import os
site.addsitedir('$PythonHome/lib/python2.6/site-packages')
sys.path.append('$PythonHome')
os.environ['PYTHON_EGG_CACHE'] = '/tmp/.egg'
from compass.api import app as application
from compass.utils import flags
from compass.utils import logsetting
from compass.utils import setting_wrapper as setting

View File

@ -1,7 +1,6 @@
# Apache config for ods server
#
# Specify python path if you use virtualenv
# WSGIPythonHome /home/vagrant/hwtest
WSGIDaemonProcess api threads=4 display-name=%{GROUP}
WSGIProcessGroup api

View File

@ -13,7 +13,8 @@ else
dhclient installation
fi
source compass-core/install/install.conf.template
/bin/bash -x compass-core/install/install.sh
/bin/bash -x compass-core/install/install.sh || exit $?
echo "cache_peer 10.145.81.137 parent 3128 3130 default" >> /etc/squid/squid.conf
service squid restart
service squid status |grep running || exit $?
sleep 5

View File

@ -35,6 +35,8 @@ function tear_down_machines() {
REGTEST_CONF=${REGTEST_CONF:-"regtest.conf"}
REGTEST_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source ${REGTEST_DIR}/${REGTEST_CONF}
source `which virtualenvwrapper.sh`
workon compass-core
declare -A roles_list
machines=''
@ -166,6 +168,7 @@ fi
${CLIENT_SCRIPT} --logfile= --loglevel=info --logdir= --networking="${NETWORKING}" --partitions="${PARTITION}" --credentials="${SECURITY}" --host_roles="${host_roles_list}" --dashboard_role="${DASHBOARD_ROLE}" --switch_ips="${SWITCH_IPS}" --machines="${machines}" --switch_credential="${SWITCH_CREDENTIAL}" --deployment_timeout="${DEPLOYMENT_TIMEOUT}" --${POLL_SWITCHES_FLAG}
rc=$?
deactivate
# Tear down machines after the test
if [[ $rc != 0 ]]; then
tear_down_machines

View File

@ -12,3 +12,7 @@ PyChef
redis
flask-wtf
itsdangerous
importlib
MySQL-python
lockfile
daemon

View File

@ -23,6 +23,7 @@
# Checking Sanity
DEBIAN=/etc/debian_version
SUSE=/etc/SuSE-release
CELERY=$CeleryPath
if [ -f $DEBIAN ]; then
. /lib/lsb/init_functions
@ -36,14 +37,14 @@ RETVAL=0
start() {
echo -n "Starting Compass Celeryd: "
if [ -f $SUSE ]; then
startproc -f -p /var/run/celeryd.pid -l /tmp/celeryd.log "C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper celery worker"
startproc -f -p /var/run/celeryd.pid -l /tmp/celeryd.log "C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY"
rc_status -v
RETVAL=$?
elif [ -f $DEBIAN ]; then
start_daemon -p /var/run/celeryd.pid "C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper celery worker &>/tmp/celeryd.log & echo \$! > /var/run/celeryd.pid"
start_daemon -p /var/run/celeryd.pid "C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY &>/tmp/celeryd.log & echo \$! > /var/run/celeryd.pid"
RETVAL=$?
else
daemon --pidfile /var/run/celeryd.pid "C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper celery worker &>/tmp/celeryd.log & echo \$! > /var/run/celeryd.pid"
daemon --pidfile /var/run/celeryd.pid "C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY &>/tmp/celeryd.log & echo \$! > /var/run/celeryd.pid"
RETVAL=$?
fi
echo
@ -53,14 +54,14 @@ start() {
stop() {
echo -n "Stopping Compass Celeryd: "
if [ -f $SUSE ]; then
killproc -t 10 -p /var/run/celeryd.pid celeryd
killproc -t 10 -p /var/run/celeryd.pid $CELERY
rc_status -v
RETVAL=$?
elif [ -f $DEBIAN ]; then
killproc -p /var/run/celeryd.pid celeryd -TERM
killproc -p /var/run/celeryd.pid $CELERY -TERM
RETVAL=$?
else
killproc -p /var/run/celeryd.pid -d 30 celeryd
killproc -p /var/run/celeryd.pid -d 30 $CELERY
RETVAL=$?
fi
echo
@ -77,12 +78,12 @@ case "$1" in
status)
echo -n "Checking compass celeryd: "
if [ -f $SUSE ]; then
checkproc -v -p /var/run/celeryd.pid celeryd
checkproc -v -p /var/run/celeryd.pid $CELERY
rc_status -v
elif [ -f $DEBIAN ]; then
status_of_proc -p /var/run/celeryd.pid celeryd celeryd
status_of_proc -p /var/run/celeryd.pid $CELERY
else
status -p /var/run/celeryd.pid celeryd
status -p /var/run/celeryd.pid $CELERY
echo
fi
;;

View File

@ -23,6 +23,7 @@
# Checking Sanity
DEBIAN=/etc/debian_version
SUSE=/etc/SuSE-release
PYTHON=$Python
if [ -f $DEBIAN ]; then
. /lib/lsb/init_functions
@ -36,14 +37,14 @@ RETVAL=0
start() {
echo -n "Starting Compass progress updated: "
if [ -f $SUSE ]; then
startproc -f -p /var/run/progress_update.pid -l /tmp/progress_update.log /opt/compass/bin/progress_update.py
startproc -f -p /var/run/progress_update.pid -l /tmp/progress_update.log $PYTHON /opt/compass/bin/progress_update.py
rc_status -v
RETVAL=$?
elif [ -f $DEBIAN ]; then
start_daemon -p /var/run/progress_update.pid "/opt/compass/bin/progress_update.py &>/tmp/progress_update.log & echo \$! > /var/run/progress_update.pid"
start_daemon -p /var/run/progress_update.pid "$PYTHON /opt/compass/bin/progress_update.py &>/tmp/progress_update.log & echo \$! > /var/run/progress_update.pid"
RETVAL=$?
else
daemon --pidfile /var/run/progress_update.pid "/opt/compass/bin/progress_update.py &>/tmp/progress_update.log & echo \$! > /var/run/progress_update.pid"
daemon --pidfile /var/run/progress_update.pid "$PYTHON /opt/compass/bin/progress_update.py &>/tmp/progress_update.log & echo \$! > /var/run/progress_update.pid"
RETVAL=$?
fi
echo
@ -80,7 +81,7 @@ case "$1" in
checkproc -v -p /var/run/progress_update.pid progress_updated
rc_status -v
elif [ -f $DEBIAN ]; then
status_of_proc -p /var/run/progress_update.pid progress_updated progress_updated
status_of_proc -p /var/run/progress_update.pid progress_updated
else
status -p /var/run/progress_update.pid progress_updated
echo