
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
96 lines
2.3 KiB
Bash
Executable File
96 lines
2.3 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# compassd Compass daemon
|
|
##################################
|
|
|
|
# LSB header
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: compassd
|
|
# Required-Start: $network $httpd
|
|
# Default-Start: 3 4 5
|
|
# Default-Stop: 0 1 2 6
|
|
# Short-Description: compassd
|
|
# Description: Compass daemon service
|
|
#
|
|
### END INIT INFO
|
|
|
|
# chkconfig header
|
|
|
|
# chkconfig: 345 98 98
|
|
# description: This is a daemon that provides Compass daemon service
|
|
#
|
|
# Checking Sanity
|
|
DEBIAN=/etc/debian_version
|
|
SUSE=/etc/SuSE-release
|
|
CELERY=$CeleryPath
|
|
|
|
if [ -f $DEBIAN ]; then
|
|
. /lib/lsb/init_functions
|
|
elif [ -f $SUSE -a -r /etc/rc.status ]; then
|
|
. /etc/rc.status
|
|
else
|
|
. /etc/rc.d/init.d/functions
|
|
fi
|
|
|
|
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"
|
|
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 &>/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 &>/tmp/celeryd.log & echo \$! > /var/run/celeryd.pid"
|
|
RETVAL=$?
|
|
fi
|
|
echo
|
|
return $RETVAL
|
|
}
|
|
|
|
stop() {
|
|
echo -n "Stopping Compass Celeryd: "
|
|
if [ -f $SUSE ]; then
|
|
killproc -t 10 -p /var/run/celeryd.pid $CELERY
|
|
rc_status -v
|
|
RETVAL=$?
|
|
elif [ -f $DEBIAN ]; then
|
|
killproc -p /var/run/celeryd.pid $CELERY -TERM
|
|
RETVAL=$?
|
|
else
|
|
killproc -p /var/run/celeryd.pid -d 30 $CELERY
|
|
RETVAL=$?
|
|
fi
|
|
echo
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
case "$1" in
|
|
start|stop|restart)
|
|
$1
|
|
;;
|
|
status)
|
|
echo -n "Checking compass celeryd: "
|
|
if [ -f $SUSE ]; then
|
|
checkproc -v -p /var/run/celeryd.pid $CELERY
|
|
rc_status -v
|
|
elif [ -f $DEBIAN ]; then
|
|
status_of_proc -p /var/run/celeryd.pid $CELERY
|
|
else
|
|
status -p /var/run/celeryd.pid $CELERY
|
|
echo
|
|
fi
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|status|restart}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
exit $RETVAL
|