X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=meta-starlingx%2Fmeta-stx-cloud%2Frecipes-devtools%2Fpython%2Ffiles%2Fpython-django-horizon%2Fhorizon.init;fp=meta-starlingx%2Fmeta-stx-cloud%2Frecipes-devtools%2Fpython%2Ffiles%2Fpython-django-horizon%2Fhorizon.init;h=0000000000000000000000000000000000000000;hb=d7aefaa6f9e2629d63a59ba4dc10fbfbc55002b3;hp=a2b15bc820f571817e1d4d7dd4cd1f3457049d66;hpb=e73864251dae725785900970dd1820d3c374ed4f;p=pti%2Frtp.git diff --git a/meta-starlingx/meta-stx-cloud/recipes-devtools/python/files/python-django-horizon/horizon.init b/meta-starlingx/meta-stx-cloud/recipes-devtools/python/files/python-django-horizon/horizon.init deleted file mode 100755 index a2b15bc..0000000 --- a/meta-starlingx/meta-stx-cloud/recipes-devtools/python/files/python-django-horizon/horizon.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: OpenStack Dashboard -# Required-Start: networking -# Required-Stop: networking -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: OpenStack Dashboard -# Description: Web based user interface to OpenStack services including -# Nova, Swift, Keystone, etc. -### END INIT INFO - -RETVAL=0 -DESC="openstack-dashboard" -PIDFILE="/var/run/$DESC.pid" -PYTHON=`which python` -# Centos packages openstack_dashboard under /usr/share -#MANAGE="@PYTHON_SITEPACKAGES@/openstack_dashboard/manage.py" -MANAGE="/usr/share/openstack-dashboard/manage.py" -EXEC="/usr/bin/gunicorn" -BIND="localhost" -PORT="8008" -WORKER="eventlet" -WORKERS=`grep workers /etc/openstack-dashboard/horizon-config.ini | cut -f3 -d' '` -# Increased timeout to facilitate large image uploads -TIMEOUT="200" -STATICDIR="/www/pages/static" -BRANDDIR="/opt/branding" -APPLIEDDIR="/opt/branding/applied" -TMPUPLOADDIR="/scratch/horizon" - -source /usr/bin/tsconfig - -start() -{ - # Change workers if combined controller/compute - . /etc/platform/platform.conf - if [ "${WORKERS}" -lt "2" ]; then - WORKERS=2 - fi - - if [ -e $PIDFILE ]; then - PIDDIR=/proc/$(cat $PIDFILE) - if [ -d ${PIDDIR} ]; then - echo "$DESC already running." - return - else - echo "Removing stale PID file $PIDFILE" - rm -f $PIDFILE - fi - fi - - # Clean up any possible orphaned worker threads - if lsof -t -i:${PORT} 1> /dev/null 2>&1; then - kill $(lsof -t -i:${PORT}) > /dev/null 2>&1 - fi - - rm -rf ${TMPUPLOADDIR} - mkdir -p ${TMPUPLOADDIR} - - echo -n "Starting $DESC..." - - start-stop-daemon --start --quiet --background --pidfile ${PIDFILE} \ - --make-pidfile --exec ${PYTHON} -- ${EXEC} --bind ${BIND}:${PORT} \ - --worker-class ${WORKER} --workers ${WORKERS} --timeout ${TIMEOUT} \ - --log-syslog \ - --config '/usr/share/openstack-dashboard/guni_config.py' \ - --pythonpath '/usr/share/openstack-dashboard' \ - openstack_dashboard.wsgi - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - echo "done." - else - echo "failed." - fi - - # now copy customer branding file to CONFIG_PATH/branding if anything updated - sm-query service drbd-platform | grep enabled-active > /dev/null 2>&1 - IS_ACTIVE=$? - - if ls ${BRANDDIR}/*.tgz 1> /dev/null 2>&1; then - LATESTBRANDING=$(ls $BRANDDIR |grep '\.tgz$' | tail -n 1) - if [ $IS_ACTIVE -eq 0 ]; then - # Only do the copy if the tarball has changed - if ! cmp --silent ${BRANDDIR}/${LATESTBRANDING} ${CONFIG_PATH}/branding/${LATESTBRANDING} ; then - mkdir -p ${CONFIG_PATH}/branding - rm -rf ${CONFIG_PATH}/branding/*.tgz - cp -r ${BRANDDIR}/${LATESTBRANDING} ${CONFIG_PATH}/branding - fi - fi - fi - - # As part of starting horizon we should kill containerized horizon so that it - # will pickup branding changes - kubectl --kubeconfig=/etc/kubernetes/admin.conf delete pods -n openstack -l application=horizon 1>/dev/null -} - -stop() -{ - if [ ! -e $PIDFILE ]; then return; fi - - echo -n "Stopping $DESC..." - - start-stop-daemon --stop --quiet --pidfile $PIDFILE - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - echo "done." - else - echo "failed." - fi - rm -rf ${TMPUPLOADDIR} - rm -f $PIDFILE -} - -status() -{ - pid=`cat $PIDFILE 2>/dev/null` - if [ -n "$pid" ]; then - if ps -p $pid &> /dev/null ; then - echo "$DESC is running" - RETVAL=0 - return - else - RETVAL=1 - fi - fi - echo "$DESC is not running" - RETVAL=3 -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|force-reload|reload) - stop - start - ;; - status) - status - ;; - *) - echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" - RETVAL=1 - ;; -esac - -exit $RETVAL