diff --git a/packages/python/st2python.spec b/packages/python/st2python.spec deleted file mode 100644 index 69b363a4..00000000 --- a/packages/python/st2python.spec +++ /dev/null @@ -1,71 +0,0 @@ - -# Redefine and set some macroses to do proper bytecompile -# (/usr/lib/rpm/brp-python-bytecompile) -# -# We ship python into /usr/local, since we need updated on OSes < rhel7 -%if "%([ -x /usr/local/bin/python ] && echo -n 1)" == "1" - %define __python /usr/local/bin/python - %define __os_install_post() \ - /usr/lib/rpm/brp-compress \ - %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \ - /usr/lib/rpm/brp-strip-static-archive %{__strip} \ - /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \ - /usr/lib/rpm/brp-python-bytecompile %{__python} \ - /usr/lib/rpm/brp-python-hardlink \ - %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \ - %{nil} -%endif - -%global unicode ucs4 - -# ================== -# Top-level metadata -# ================== -Summary: An interpreted, interactive, object-oriented programming language -Name: st2python -Version: %(echo -n "${ST2_PYTHON_VERSION:-2.7.10}") -Release: %(echo -n "${ST2_PYTHON_RELEASE:-1}") -License: Python -Group: Development/Languages -Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz - -%description -Python is an interpreted, interactive, object-oriented programming -language often compared to Tcl, Perl, Scheme or Java. Python includes -modules, classes, exceptions, very high level dynamic data types and -dynamic typing. Python supports interfaces to many system calls and -libraries, as well as to various windowing systems (X11, Motif, Tk, -Mac and MFC). - -Programmers can write new built-in modules for Python in C or C++. -Python can be used as an extension language for applications that need -a programmable interface. - -%prep -%setup -q -n Python-%{version} - -%build -topdir=$(pwd) -./configure \ - --enable-ipv6 \ - --enable-unicode=%{unicode} \ - --prefix=/usr/share/python/st2python \ - --exec-prefix=/usr/share/python/st2python - %{nil} - -# Patch cgi.py to use absolute path, info inside the file. -sed -i '1s:/usr/local/bin/python:/usr/share/python/st2python/bin/python:' Lib/cgi.py -make - -%install -topdir=$(pwd) -rm -rf %{buildroot} -mkdir -p %{buildroot}%{_prefix} -make install DESTDIR=%{buildroot} - -# cleanout tests (some of them have python3 syntax) -rm -rf %{buildroot}%{_datadir}/python/st2python/lib/python2.7/test -rm -rf %{buildroot}%{_datadir}/python/st2python/lib/python2.7/lib2to3/tests - -%files - %{_datadir}/python/st2python diff --git a/packages/st2/Makefile b/packages/st2/Makefile index 6e45cd86..c671315b 100644 --- a/packages/st2/Makefile +++ b/packages/st2/Makefile @@ -27,11 +27,6 @@ else ifeq ($(EL_VERSION),8) PYTHON_BINARY := /usr/bin/python3 PIP_BINARY := /usr/local/bin/pip3 PYTHON_ALT_BINARY := python3 -else ifneq (,$(wildcard /usr/share/python/st2python/bin/python)) - PATH := /usr/share/python/st2python/bin:$(PATH) - PYTHON_BINARY := /usr/share/python/st2python/bin/python - PIP_BINARY := pip - PYTHON_ALT_BINARY := python else PYTHON_BINARY := python PIP_BINARY := pip diff --git a/packages/st2/component.makefile b/packages/st2/component.makefile index b5ae3dd6..baba04ca 100644 --- a/packages/st2/component.makefile +++ b/packages/st2/component.makefile @@ -25,10 +25,6 @@ ifeq ($(DEB_DISTRO),bionic) else ifeq ($(EL_VERSION),8) PYTHON_BINARY := /usr/bin/python3 PIP_BINARY := /usr/local/bin/pip3 -else ifneq (,$(wildcard /usr/share/python/st2python/bin/python)) - PATH := /usr/share/python/st2python/bin:$(PATH) - PYTHON_BINARY := /usr/share/python/st2python/bin/python - PIP_BINARY := pip else PYTHON_BINARY := python PIP_BINARY := pip diff --git a/packages/st2/conf/rhel-functions-sysvinit b/packages/st2/conf/rhel-functions-sysvinit deleted file mode 100644 index c5948948..00000000 --- a/packages/st2/conf/rhel-functions-sysvinit +++ /dev/null @@ -1,241 +0,0 @@ -# -*-Shell-script-*- - -# Redhat daemon function with process group change ability -# preserving supplementary groups. -# -daemon() { - # Test syntax. - local gotbase= force= nicelevel corelimit - local pid base= user= nice= bg= pid_file= - local cgroup= - local group= group_opts= suppgroup_opts= - local background= daemoncmd= - nicelevel=0 - while [ "$1" != "${1##[-+]}" ]; do - case $1 in - '') echo $"$0: Usage: daemon [+/-nicelevel] {program}" - return 1;; - --check) - base=$2 - gotbase="yes" - shift 2 - ;; - --check=?*) - base=${1#--check=} - gotbase="yes" - shift - ;; - --user) - user=$2 - shift 2 - ;; - --user=?*) - user=${1#--user=} - shift - ;; - --group) - group=$2 - shift 2 - ;; - --group=?*) - group=${1#--group=} - shift - ;; - --pidfile) - pid_file=$2 - shift 2 - ;; - --pidfile=?*) - pid_file=${1#--pidfile=} - shift - ;; - --force) - force="force" - shift - ;; - --background) - background="yes" - shift - ;; - [-+][0-9]*) - nice="nice -n $1" - shift - ;; - *) echo $"$0: Usage: daemon [+/-nicelevel] {program}" - return 1;; - esac - done - - # Save basename. - [ -z "$gotbase" ] && base=${1##*/} - - # See if it's already running. Look *only* at the pid file. - __pids_var_run "$base" "$pid_file" - - [ -n "$pid" -a -z "$force" ] && return - - # make sure it doesn't core dump anywhere unless requested - corelimit="ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0}" - - # if they set NICELEVEL in /etc/sysconfig/foo, honor it - [ -n "${NICELEVEL:-}" ] && nice="nice -n $NICELEVEL" - - # if they set CGROUP_DAEMON in /etc/sysconfig/foo, honor it - if [ -n "${CGROUP_DAEMON}" ]; then - if [ ! -x /bin/cgexec ]; then - echo -n "Cgroups not installed"; warning - echo - else - cgroup="/bin/cgexec"; - for i in $CGROUP_DAEMON; do - cgroup="$cgroup -g $i"; - done - fi - fi - - # Echo daemon - [ "${BOOTUP:-}" = "verbose" -a -z "${LSB:-}" ] && echo -n " $base" - - # Group and supplementary group list options (-G grp1 -G grp2). - # If group is not overrided runuser will pick up supplementary groups, - # so no need to set them specifically. - if [ ! -z "$group" ]; then - group_opts="-g $group" - suppgroup_opts=$(id -nG $user | sed 's/^\| / -G /g') - fi - - # Wrap daemon command call with nohup, if background options is given. - [ -z "$background" ] && daemoncmd="$*" || - daemoncmd="nohup /dev/null 2>&1 $* &" - - # And start it up. - : ${user:=root} - $cgroup $nice runuser $group_opts $suppgroup_opts $user \ - -s /bin/bash -c "$corelimit >/dev/null 2>&1 ; $daemoncmd" - - # Write completion message only when starting a real daemon. - if [ -z "$background" ]; then - [ "$?" -eq 0 ] && success $"$base startup" || failure $"$base startup" - fi -} - - -# Write pid of a starting daemon into the pidfile. -# By default wait for the pid up to 5 seconds. -pgrep_waitforpid() { - local pid= pid_file= base= trailer= - local pgrep_opts="-n" timeout="5.0" - - while [ "$1" != "${1##--}" ]; do - case $1 in - '') echo $"$0: Usage: pgrep_waitforpid {program}" - return 1;; - --masterpid) - pgrep_opts="-o" - shift - ;; - --pidfile) - pid_file=$2 - shift 2 - ;; - --pidfile=?*) - pid_file=${1#--pidfile=} - shift - ;; - --scriptname) - base=$2 - shift 2 - ;; - --scriptname=?*) - base=${1#--scriptname=} - shift - ;; - --timeout) - timeout=$2 - shift 2 - ;; - --timeout=?*) - timeout=${1#--timeout=} - shift - ;; - - *) echo $"$0: Usage: pgrep_waitforpid {program}" - return 1;; - esac - done - - # Locate pid of a started daemon (oldest pid in case if masterpid is given). - [ -z "$scriptname"] || trailer=".*${scriptname}" - - # Check for pid in a cycle until found or timed-out. - # - for s in $(seq 0.0 0.1 $timeout); do - pid=$(pgrep $pgrep_opts -f "$1${trailer}") - if [ ! -z "$pid" ]; then - # In case of false-positve during forking, double check that pid exists. - sleep 0.1; checkpid $pid && break || continue - else - sleep 0.1 - fi - done - - # Define pid_file path. - [ -z "$base" ] && base=${1##*/} - pid_file=${pid_file:-/var/run/$base.pid} - - if checkpid $pid; then - echo $pid > $pid_file - success $"$base startup" - else - failure $"$base startup" - fi -} - -# Waits for a process startup and when it writes the pidfile. -waitforpid() { - local pid= pid_file= base= timeout="5.0" - - while [ "$1" != "${1##--}" ]; do - case $1 in - '') echo $"$0: Usage: waitforpid [options]" - return 1;; - --pidfile) - pid_file=$2 - shift 2 - ;; - --pidfile=?*) - pid_file=${1#--pidfile=} - shift - ;; - --timeout) - timeout=$2 - shift 2 - ;; - --timeout=?*) - timeout=${1#--timeout=} - shift - ;; - - *) echo $"$0: Usage: waitforpid [options]" - return 1;; - esac - done - - # Define pid_file path. - [ -z "$base" ] && base=${1##*/} - pid_file=${pid_file:-/var/run/$base.pid} - - # Check for pid in a cycle until found or timed-out. - # - for s in $(seq 0.0 0.1 $timeout); do - if [ -f "$pid_file" ]; then - # In case process dies or anything, we keep iterating - pid=$(cat $pid_file) - sleep 0.1; checkpid $pid && break || continue - else - sleep 0.1 - fi - done - - checkpid $pid && success $"$base startup" || failure $"$base startup" -} diff --git a/packages/st2/debian/rules b/packages/st2/debian/rules index 03b9f242..e494c7ab 100755 --- a/packages/st2/debian/rules +++ b/packages/st2/debian/rules @@ -45,7 +45,6 @@ override_dh_gencontrol: # Packaging recognizes only 1 {package_name} service file (http://manpages.ubuntu.com/manpages/xenial/man1/dh_installinit.1.html) # We have many, and so force it to install multiple service files override_dh_installinit: -ifeq (true, $(IS_SYSTEMD)) dh_systemd_enable --name=st2actionrunner st2actionrunner.service install -p -m644 debian/st2actionrunner@.service debian/st2/lib/systemd/system/st2actionrunner@.service dh_systemd_enable --name=st2api st2api.service @@ -59,22 +58,6 @@ ifeq (true, $(IS_SYSTEMD)) dh_systemd_enable --name=st2timersengine st2timersengine.service dh_systemd_enable --name=st2workflowengine st2workflowengine.service dh_systemd_enable --name=st2scheduler st2scheduler.service -else - # So far don't start services - dh_installinit --no-start --name=st2actionrunner-worker - dh_installinit --no-start --name=st2actionrunner - dh_installinit --no-start --name=st2api - dh_installinit --no-start --name=st2stream - dh_installinit --no-start --name=st2auth - dh_installinit --no-start --name=st2notifier - dh_installinit --no-start --name=st2resultstracker - dh_installinit --no-start --name=st2rulesengine - dh_installinit --no-start --name=st2sensorcontainer - dh_installinit --no-start --name=st2garbagecollector - dh_installinit --no-start --name=st2timersengine - dh_installinit --no-start --name=st2workflowengine - dh_installinit --no-start --name=st2scheduler -endif override_dh_installdeb: DESTDIR=debian/st2 $(MAKE) post_install diff --git a/packages/st2/rpm/st2.spec b/packages/st2/rpm/st2.spec index 014ec161..5f5ae201 100644 --- a/packages/st2/rpm/st2.spec +++ b/packages/st2/rpm/st2.spec @@ -10,10 +10,6 @@ Epoch: %{epoch} %endif -%if 0%{?use_st2python} -Requires: st2python, python-devel, openssl-devel, libffi-devel, git, pam, openssh-server, openssh-clients, bash, setup -%endif - %if 0%{?rhel} == 7 Requires: python-devel, openssl-devel, libffi-devel, git, pam, openssh-server, openssh-clients, bash, setup %endif @@ -40,7 +36,7 @@ Conflicts: st2common all components # Define worker name -%define worker_name %{!?use_systemd:st2actionrunner-worker}%{?use_systemd:st2actionrunner@} +%define worker_name st2actionrunner@ %install @@ -50,7 +46,6 @@ Conflicts: st2common %service_install st2resultstracker st2rulesengine st2timersengine st2sensorcontainer st2garbagecollector %service_install st2scheduler make post_install DESTDIR=%{buildroot} - %{!?use_systemd:install -D -m644 conf/rhel-functions-sysvinit %{buildroot}/opt/stackstorm/st2/share/sysvinit/functions} %cleanup_python_abspath @@ -100,7 +95,6 @@ Conflicts: st2common %attr(775, root, %{packs_group}) /opt/stackstorm/packs/* %attr(775, root, %{packs_group}) /usr/share/doc/st2/examples %attr(775, root, %{packs_group}) /opt/stackstorm/virtualenvs -%if 0%{?use_systemd} %{_unitdir}/st2actionrunner.service %{_unitdir}/%{worker_name}.service %{_unitdir}/st2api.service @@ -117,18 +111,3 @@ Conflicts: st2common %{_unitdir}/st2timersengine.service %{_unitdir}/st2workflowengine.service %{_unitdir}/st2scheduler.service -%else - %{_sysconfdir}/rc.d/init.d/st2actionrunner - %{_sysconfdir}/rc.d/init.d/%{worker_name} - %{_sysconfdir}/rc.d/init.d/st2api - %{_sysconfdir}/rc.d/init.d/st2stream - %{_sysconfdir}/rc.d/init.d/st2auth - %{_sysconfdir}/rc.d/init.d/st2notifier - %{_sysconfdir}/rc.d/init.d/st2resultstracker - %{_sysconfdir}/rc.d/init.d/st2rulesengine - %{_sysconfdir}/rc.d/init.d/st2timersengine - %{_sysconfdir}/rc.d/init.d/st2sensorcontainer - %{_sysconfdir}/rc.d/init.d/st2garbagecollector - %{_sysconfdir}/rc.d/init.d/st2workflowengine - %{_sysconfdir}/rc.d/init.d/st2scheduler -%endif diff --git a/packages/st2/rpm/st2actionrunner-worker.init b/packages/st2/rpm/st2actionrunner-worker.init deleted file mode 100644 index 3cb27790..00000000 --- a/packages/st2/rpm/st2actionrunner-worker.init +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2actionrunner -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2actionrunner component -# Description: StackStorm st2actionrunner-worker -### END INIT INFO - -# st2actionrunner This shell script takes care of starting and stopping -# st2actionrunner worker daemon. -# chkconfig: - 85 15 -# description: StackStorm st2actionrunner-worker -# processname: st2actionrunner - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="st2actionrunner-worker" -NAME=st2actionrunner -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME-${WORKERID}.pid -RUNAS_USER="root" -RUNAS_GROUP="st2packs" -UMASK=002 - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - -# Check if invoked worker service directly -if [ -z $WORKERID ]; then - failure "Can't start this service directly, use /etc/init.d/st2actionrunner instead" - exit 3 -fi - -# Set required umask -umask $UMASK - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} --group=${RUNAS_GROUP} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} --pidfile=${PIDFILE} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $PIDFILE -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2actionrunner.init b/packages/st2/rpm/st2actionrunner.init deleted file mode 100644 index f2e4c074..00000000 --- a/packages/st2/rpm/st2actionrunner.init +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2actionrunner -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2actionrunner component -# Description: StackStorm actionrunner wrapper service -### END INIT INFO - -# st2actionrunner This shell script takes care of starting and stopping -# st2actionrunner daemon. -# chkconfig: - 85 15 -# description: StackStorm actionrunner wrapper service -# processname: st2actionrunner - -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="st2actionrunner" -NAME=st2actionrunner -DAEMON=/opt/stackstorm/st2/bin/$NAME -SPAWNER=/opt/stackstorm/st2/bin/runners.sh -export WORKERS - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - $SPAWNER start -} - -stop() { - $SPAWNER stop -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - $SPAWNER status -} - -case "$1" in - start|stop|restart|reload) - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2api.init b/packages/st2/rpm/st2api.init deleted file mode 100644 index 8dd5d0a9..00000000 --- a/packages/st2/rpm/st2api.init +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2api -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2api component -# Description: St2Api - StackStorm service st2api -### END INIT INFO - -# st2api This shell script takes care of starting and stopping -# st2api daemon. -# chkconfig: - 85 15 -# description: St2Api - StackStorm service st2api -# processname: st2api - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2api" -NAME=st2api -DAEMON=/opt/stackstorm/st2/bin/gunicorn -PIDFILE=/var/run/st2/$NAME.pid -DAEMON_ARGS="-k eventlet -b 127.0.0.1:9101 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.api.gunicorn.conf --error-logfile /var/log/st2/st2api.log --pid ${PIDFILE}" -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport -DAEMON_ARGS="st2api.wsgi:application ${DAEMON_ARGS}" - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - waitforpid --pidfile=${PIDFILE} - retval=$? - [ $retval -ne 0 ] && return $retval - # wait for st2api readiness to serve the requests - timeout 5 bash -c 'until echo > /dev/tcp/127.0.0.1/9101; do sleep 0.5; done' - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $PIDFILE $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2auth.init b/packages/st2/rpm/st2auth.init deleted file mode 100644 index ed7cf927..00000000 --- a/packages/st2/rpm/st2auth.init +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2auth -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2auth component -# Description: St2Auth - StackStorm authentication service component -### END INIT INFO - -# st2auth This shell script takes care of starting and stopping -# st2auth daemon. -# chkconfig: - 85 15 -# description: St2Auth - StackStorm authentication service component -# processname: st2auth - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2auth" -NAME=st2auth -DAEMON=/opt/stackstorm/st2/bin/gunicorn -PIDFILE=/var/run/st2/$NAME.pid -DAEMON_ARGS="-k eventlet -b 127.0.0.1:9100 --workers 1 --threads 1 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.auth.gunicorn.conf --error-logfile /var/log/st2/st2auth.log --pid ${PIDFILE}" -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport -DAEMON_ARGS="st2auth.wsgi:application ${DAEMON_ARGS}" - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - waitforpid --pidfile=${PIDFILE} - retval=$? - [ $retval -ne 0 ] && return $retval - # wait for st2auth readiness to serve the requests - timeout 5 bash -c 'until echo > /dev/tcp/127.0.0.1/9100; do sleep 0.5; done' - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $PIDFILE $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2exporter.init b/packages/st2/rpm/st2exporter.init deleted file mode 100644 index 3a009f22..00000000 --- a/packages/st2/rpm/st2exporter.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2exporter -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2exporter component -# Description: St2Exporter - StackStorm service st2exporter -### END INIT INFO - -# st2exporter This shell script takes care of starting and stopping -# st2exporter daemon. -# chkconfig: - 85 15 -# description: St2Exporter - StackStorm service st2exporter -# processname: st2exporter - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2exporter" -NAME=st2exporter -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2garbagecollector.init b/packages/st2/rpm/st2garbagecollector.init deleted file mode 100644 index 2c2fdb0d..00000000 --- a/packages/st2/rpm/st2garbagecollector.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2garbagecollector -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2garbagecollector component -# Description: st2garbagecollector - StackStorm service st2garbagecollector -### END INIT INFO - -# st2garbagecollector This shell script takes care of starting and stopping -# st2garbagecollector daemon. -# chkconfig: - 85 15 -# description: st2garbagecollector - StackStorm service st2garbagecollector -# processname: st2garbagecollector - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2garbagecollector" -NAME=st2garbagecollector -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2notifier.init b/packages/st2/rpm/st2notifier.init deleted file mode 100644 index 99188c69..00000000 --- a/packages/st2/rpm/st2notifier.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2notifier -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2notifier component -# Description: St2Notifer - StackStorm service st2notifier -### END INIT INFO - -# st2notifier This shell script takes care of starting and stopping -# st2notifier daemon. -# chkconfig: - 85 15 -# description: St2Notifer - StackStorm service st2notifier -# processname: st2notifier - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2notifier" -NAME=st2notifier -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2resultstracker.init b/packages/st2/rpm/st2resultstracker.init deleted file mode 100644 index bb84df96..00000000 --- a/packages/st2/rpm/st2resultstracker.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2resultstracker -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2resultstracker component -# Description: St2Notifer - StackStorm service st2resultstracker -### END INIT INFO - -# st2resultstracker This shell script takes care of starting and stopping -# st2resultstracker daemon. -# chkconfig: - 85 15 -# description: St2ResultsTracker - StackStorm service st2resultstracker -# processname: st2resultstracker - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2resultstracker" -NAME=st2resultstracker -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2rulesengine.init b/packages/st2/rpm/st2rulesengine.init deleted file mode 100644 index db1d68e7..00000000 --- a/packages/st2/rpm/st2rulesengine.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2rulesengine -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2rulesengine component -# Description: St2RulesEngine - StackStorm service st2rulesengine -### END INIT INFO - -# st2rulesengine This shell script takes care of starting and stopping -# st2rulesengine daemon. -# chkconfig: - 85 15 -# description: St2RulesEngine - StackStorm service st2rulesengine -# processname: st2rulesengine - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2rulesengine" -NAME=st2rulesengine -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2scheduler.init b/packages/st2/rpm/st2scheduler.init deleted file mode 100644 index 2f85cb59..00000000 --- a/packages/st2/rpm/st2scheduler.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2scheduler -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2scheduler component -# Description: st2scheduler - StackStorm service st2scheduler -### END INIT INFO - -# st2scheduler This shell script takes care of starting and stopping -# st2scheduler daemon. -# chkconfig: - 85 15 -# description: st2scheduler - StackStorm service st2scheduler -# processname: st2scheduler - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2scheduler" -NAME=st2scheduler -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2sensorcontainer.init b/packages/st2/rpm/st2sensorcontainer.init deleted file mode 100644 index e0285199..00000000 --- a/packages/st2/rpm/st2sensorcontainer.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2sensorcontainer -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2sensorcontainer component -# Description: St2SensorContainer - StackStorm service st2sensorcontainer -### END INIT INFO - -# st2sensorcontainer This shell script takes care of starting and stopping -# st2sensorcontainer daemon. -# chkconfig: - 85 15 -# description: St2SensorContainer - StackStorm service st2sensorcontainer -# processname: st2sensorcontainer - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2sensorcontainer" -NAME=st2sensorcontainer -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2stream.init b/packages/st2/rpm/st2stream.init deleted file mode 100644 index 3e012215..00000000 --- a/packages/st2/rpm/st2stream.init +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2stream -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2stream component -# Description: St2Api - StackStorm service st2stream -### END INIT INFO - -# st2stream This shell script takes care of starting and stopping -# st2stream daemon. -# chkconfig: - 85 15 -# description: St2Api - StackStorm service st2stream -# processname: st2stream - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2stream" -NAME=st2stream -DAEMON=/opt/stackstorm/st2/bin/gunicorn -PIDFILE=/var/run/st2/$NAME.pid -DAEMON_ARGS="-k eventlet -b 127.0.0.1:9102 --workers 1 --threads 10 --graceful-timeout 10 --timeout 30 --log-config /etc/st2/logging.stream.gunicorn.conf --error-logfile /var/log/st2/st2stream.log --pid ${PIDFILE}" -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport -DAEMON_ARGS="st2stream.wsgi:application ${DAEMON_ARGS}" - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - waitforpid --pidfile=${PIDFILE} - retval=$? - [ $retval -ne 0 ] && return $retval - # wait for st2stream readiness to serve the requests - timeout 5 bash -c 'until echo > /dev/tcp/127.0.0.1/9102; do sleep 0.5; done' - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $PIDFILE $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2timersengine.init b/packages/st2/rpm/st2timersengine.init deleted file mode 100644 index 0e54395f..00000000 --- a/packages/st2/rpm/st2timersengine.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2timersengine -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2timersengine component -# Description: st2timersengine - StackStorm service st2timersengine -### END INIT INFO - -# st2timersengine This shell script takes care of starting and stopping -# st2timersengine daemon. -# chkconfig: - 85 15 -# description: st2timersengine - StackStorm service st2timersengine -# processname: st2timersengine - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2timersengine" -NAME=st2timersengine -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2/rpm/st2workflowengine.init b/packages/st2/rpm/st2workflowengine.init deleted file mode 100644 index 47ce611c..00000000 --- a/packages/st2/rpm/st2workflowengine.init +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: st2workflowengine -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: st2workflowengine component -# Description: St2WorkflowEngine - StackStorm service st2workflowengine -### END INIT INFO - -# st2workflowengine This shell script takes care of starting and stopping -# st2workflowengine daemon. -# chkconfig: - 85 15 -# description: St2WorkflowEngine - StackStorm service st2workflowengine -# processname: st2workflowengine - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/st2/share/sysvinit/functions - -DESC="st2workflowengine" -NAME=st2workflowengine -DAEMON=/opt/stackstorm/st2/bin/$NAME -DAEMON_ARGS="--config-file /etc/st2/st2.conf" -PIDFILE=/var/run/$NAME.pid -RUNAS_USER="st2" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2mistral/Makefile b/packages/st2mistral/Makefile index 01d0f0e2..a01148f6 100644 --- a/packages/st2mistral/Makefile +++ b/packages/st2mistral/Makefile @@ -13,10 +13,6 @@ $(PBR_GITURL) endef export INJECT_DEPS -ifneq (,$(wildcard /usr/share/python/st2python/bin/python)) - PATH := /usr/share/python/st2python/bin:$(PATH) -endif - ifneq (,$(wildcard /etc/debian_version)) DEBIAN := 1 DESTDIR ?= $(CURDIR)/debian/$(COMPONENT) diff --git a/packages/st2mistral/debian/mistral-api.init b/packages/st2mistral/debian/mistral-api.init deleted file mode 100644 index e54b79e2..00000000 --- a/packages/st2mistral/debian/mistral-api.init +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: mistral-api -# Required-Start: $local_fs $network $remote_fs $syslog -# Required-Stop: $local_fs $network $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Workflow as a Service mistral api -# Description: Debain sysvinit for mistral. -# -### END INIT INFO - -# Author: StackStorm Engineering - -# Do NOT "set -e" - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="mistral" -NAME=mistral-api -DAEMON=/opt/stackstorm/mistral/bin/gunicorn -COMPONENTS="api,engine,executor,notifier" -RUN_DIR="/var/run/mistral" -PIDFILE="${RUN_DIR}/$NAME.pid" -SCRIPTNAME=/etc/init.d/$NAME -RUNAS_USER="mistral" -RUNAS_GROUP="mistral" -API_ARGS="--log-file /var/log/mistral/mistral-api.log -b 127.0.0.1:8989 -w 2 mistral.api.wsgi --graceful-timeout 10 --pid ${PIDFILE}" -UMASK=022 - - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 0 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/default/mistral ] && . /etc/default/mistral -set +o allexport -DAEMON_ARGS="${API_ARGS}" - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.2-14) to ensure that this file is present -# and status_of_proc is working. -. /lib/lsb/init-functions - -# Source our helpers -. /opt/stackstorm/mistral/share/sysvinit/helpers - - -# -# Check if service is running (docker fail-safe) -# returns: 0 - not running, 1 - running -# -lsb_running() -{ - local retval=1 pid="$(cat $PIDFILE 2>/dev/null)" - [ ! -z $pid ] && [ -d /proc/$pid ] && \ - cat /proc/$pid/cmdline | grep -q $DAEMON && retval=0 - return $retval -} - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - lsb_running && return 1 - - # Check if ${RUN_DIR} exists, if not create. Otherwise the service will not start. - [ -d ${RUN_DIR} ] || install -m 755 -o ${RUNAS_USER} -g root -d ${RUN_DIR} - - start-stop-daemon --start --quiet --chuid $RUNAS_USER:$RUNAS_GROUP --umask $UMASK --background --pidfile $PIDFILE \ - --exec $DAEMON -- $DAEMON_ARGS \ - || return 2 -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - # Many daemons don't delete their pidfiles when they exit. - rm -f $PIDFILE - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE - return 0 -} - - -# NB! Exit if mistral-api is disabled -enabled_list -q api || exit 0 - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/packages/st2mistral/debian/mistral-server.init b/packages/st2mistral/debian/mistral-server.init deleted file mode 100644 index ac80b5c1..00000000 --- a/packages/st2mistral/debian/mistral-server.init +++ /dev/null @@ -1,184 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: mistral-server -# Required-Start: $local_fs $network $remote_fs $syslog -# Required-Stop: $local_fs $network $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Workflow as a Service mistral for engine/executor -# Description: Debain sysvinit for mistral. -# -### END INIT INFO - -# Author: StackStorm Engineering - -# Do NOT "set -e" - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="mistral" -NAME=mistral-server -DAEMON=/opt/stackstorm/mistral/bin/$NAME -COMPONENTS="api,engine,executor,notifier" -SERVER_ARGS="--config-file /etc/mistral/mistral.conf --log-file /var/log/mistral/mistral-server.log" -RUN_DIR="/var/run/mistral" -PIDFILE="${RUN_DIR}/$NAME.pid" -SCRIPTNAME=/etc/init.d/$NAME -RUNAS_USER="mistral" -RUNAS_GROUP="mistral" -UMASK=022 - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 0 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/default/mistral ] && . /etc/default/mistral -set +o allexport - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.2-14) to ensure that this file is present -# and status_of_proc is working. -. /lib/lsb/init-functions - -# Source our helpers -. /opt/stackstorm/mistral/share/sysvinit/helpers - - -# -# Check if service is running (docker fail-safe) -# returns: 0 - not running, 1 - running -# -lsb_running() -{ - local retval=1 pid="$(cat $PIDFILE 2>/dev/null)" - [ ! -z $pid ] && [ -d /proc/$pid ] && \ - cat /proc/$pid/cmdline | grep -q $DAEMON && retval=0 - return $retval -} - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - lsb_running && return 1 - - # Check if ${RUN_DIR} exists, if not create. Otherwise the service will not start. - [ -d ${RUN_DIR} ] || install -m 755 -o ${RUNAS_USER} -g root -d ${RUN_DIR} - - start-stop-daemon --start --quiet --chuid $RUNAS_USER:$RUNAS_GROUP --umask $UMASK --background --make-pidfile --pidfile $PIDFILE \ - --exec $DAEMON -- $DAEMON_ARGS \ - || return 2 -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - # Many daemons don't delete their pidfiles when they exit. - rm -f $PIDFILE - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE - return 0 -} - - -# Exit if server components are disabled, otherwise inject them into args. -enabled_list -q server || exit 0 -DAEMON_ARGS="--server $(enabled_list server) ${SERVER_ARGS}" - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/packages/st2mistral/debian/mistral.init b/packages/st2mistral/debian/mistral.init deleted file mode 100644 index f13f87eb..00000000 --- a/packages/st2mistral/debian/mistral.init +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: mistral -# Required-Start: $local_fs $network $remote_fs $syslog -# Required-Stop: $local_fs $network $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Workflow as a Service mistral -# Description: Debain sysvinit for mistral. -# -### END INIT INFO - -# Author: StackStorm Engineering - -# Do NOT "set -e" - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="mistral" -NAME=mistral -SCRIPTNAME=/etc/init.d/$NAME - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/default/$NAME ] && . /etc/default/$NAME -set +o allexport - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.2-14) to ensure that this file is present -# and status_of_proc is working. -. /lib/lsb/init-functions - - -mistral_wrapper() { - local action="$1" rs= retval=0 - /etc/init.d/mistral-api $action - rs=$?; [ $rs -gt $retval ] && retval=$rs - /etc/init.d/mistral-server $action - rs=$?; [ $rs -gt $retval ] && retval=$rs - return $retval -} - -# -# Function that starts the daemon/service -# -do_start() -{ - mistral_wrapper start -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - mistral_wrapper stop -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - mistral_wrapper reload -} - -do_status() { - mistral_wrapper status -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - do_status && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/packages/st2mistral/rpm/mistral-api.init b/packages/st2mistral/rpm/mistral-api.init deleted file mode 100644 index d484160a..00000000 --- a/packages/st2mistral/rpm/mistral-api.init +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: mistral-api -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: mistral service -# Description: Mistral workflow service api -### END INIT INFO - -# mistral This shell script takes care of starting and stopping -# mistral daemon. -# chkconfig: - 85 15 -# description: Mistral workflow service api -# processname: mistral - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/mistral/share/sysvinit/helpers -. /opt/stackstorm/mistral/share/sysvinit/functions - - -DESC="mistral" -NAME=mistral-api -DAEMON=/opt/stackstorm/mistral/bin/gunicorn -COMPONENTS="api,engine,executor,notifier" -PIDFILE=/var/run/mistral/$NAME.pid -API_ARGS="--log-file /var/log/mistral/mistral-api.log -b 127.0.0.1:8989 -w 2 mistral.api.wsgi --graceful-timeout 10 --pid ${PIDFILE}" -RUNAS_USER="mistral" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/mistral ] && . /etc/sysconfig/mistral -set +o allexport -DAEMON_ARGS="${API_ARGS}" - -# NB! Exit if mistral-api is disabled -enabled_list -q api || exit 0 - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - waitforpid --pidfile=${PIDFILE} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $PIDFILE $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2mistral/rpm/mistral-server.init b/packages/st2mistral/rpm/mistral-server.init deleted file mode 100644 index e3b6eb4d..00000000 --- a/packages/st2mistral/rpm/mistral-server.init +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: mistral-server -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: mistral service -# Description: Mistral workflow service (engine/executor) -### END INIT INFO - -# mistral This shell script takes care of starting and stopping -# mistral daemon. -# chkconfig: - 85 15 -# description: Mistral workflow service (engine/executor) -# processname: mistral - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source networking configuration. -. /etc/sysconfig/network - -# Source our sysv functions -. /opt/stackstorm/mistral/share/sysvinit/helpers -. /opt/stackstorm/mistral/share/sysvinit/functions - -DESC="mistral" -NAME=mistral-server -DAEMON=/opt/stackstorm/mistral/bin/mistral-server -COMPONENTS="api,engine,executor,notifier" -SERVER_ARGS="--config-file /etc/mistral/mistral.conf --log-file /var/log/mistral/mistral-server.log" -PIDFILE=/var/run/mistral/$NAME.pid -RUNAS_USER="mistral" - -lockfile=/var/lock/subsys/$NAME - -# Exit if the package is not installed -[ -x "$DAEMON" ] || exit 5 - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/mistral ] && . /etc/sysconfig/mistral -set +o allexport - - -# NB! Exit if mistral-server is disabled -enabled_list -q server || exit 0 -DAEMON_ARGS="--server $(enabled_list server) ${SERVER_ARGS}" - - -start() { - echo -n $"Starting $NAME: " - daemon --background --check=${NAME} --user=${RUNAS_USER} \ - $DAEMON $DAEMON_ARGS - pgrep_waitforpid --scriptname=${NAME} --pidfile=${PIDFILE} ${DAEMON} - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile || return $retval -} - -stop() { - echo -n $"Stopping $NAME: " - killproc -p $PIDFILE $DAEMON - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile || return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status -p $PIDFILE $NAME -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2mistral/rpm/mistral.init b/packages/st2mistral/rpm/mistral.init deleted file mode 100644 index e07e1edf..00000000 --- a/packages/st2mistral/rpm/mistral.init +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh -# -### BEGIN INIT INFO -# Provides: mistral -# Required-Start: $local_fs $network $named $remote_fs $syslog -# Required-Stop: $local_fs $network $named $remote_fs $syslog -# Short-Description: mistral service -# Description: Mistral wrapper service -### END INIT INFO - -# mistral This shell script takes care of starting and stopping -# mistral daemon. -# chkconfig: - 85 15 -# description: Mistral wrapper service -# processname: mistral - - -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="mistral" -NAME=mistral - -# Read configuration variable file if it is present -set -o allexport -[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME -set +o allexport - - -# Mistral wrapper passes execution to mistral-api and mistral-server -mistral_wrapper() { - local action="$1" rs= retval=0 - /etc/init.d/mistral-api $action - rs=$?; [ $rs -gt $retval ] && retval=$rs - /etc/init.d/mistral-server $action - rs=$?; [ $rs -gt $retval ] && retval=$rs - return $retval -} - -start() { - mistral_wrapper start -} - -stop() { - mistral_wrapper stop -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - mistral_wrapper status -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - - -case "$1" in - start) - $1 - ;; - stop) - $1 - ;; - restart) - $1 - ;; - reload) - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 -esac -exit $? diff --git a/packages/st2mistral/rpm/st2mistral.spec b/packages/st2mistral/rpm/st2mistral.spec index 13fa7558..a9b35941 100644 --- a/packages/st2mistral/rpm/st2mistral.spec +++ b/packages/st2mistral/rpm/st2mistral.spec @@ -16,11 +16,7 @@ Group: System/Management License: Apache 2.0 Url: https://github.com/StackStorm/mistral Source0: . -%if 0%{?use_st2python} -Requires: st2python, bash, procps -%else Requires: bash, procps -%endif Provides: openstack-mistral Summary: st2 Mistral workflow service @@ -36,7 +32,6 @@ Summary: st2 Mistral workflow service %pip_install_venv %service_install mistral mistral-api mistral-server make post_install DESTDIR=%{?buildroot} - %{!?use_systemd:install -D -m644 conf/rhel-functions-sysvinit %{buildroot}/opt/stackstorm/mistral/share/sysvinit/functions} %cleanup_python_abspath @@ -67,12 +62,6 @@ Summary: st2 Mistral workflow service %config(noreplace) %{_sysconfdir}/logrotate.d/mistral %attr(755, %{svc_user}, root) %{_localstatedir}/log/mistral %attr(755, %{svc_user}, root) %{_localstatedir}/run/mistral -%if 0%{?use_systemd} %{_unitdir}/mistral.service %{_unitdir}/mistral-api.service %{_unitdir}/mistral-server.service -%else - %{_sysconfdir}/rc.d/init.d/mistral - %{_sysconfdir}/rc.d/init.d/mistral-api - %{_sysconfdir}/rc.d/init.d/mistral-server -%endif diff --git a/rake/build/environment.rb b/rake/build/environment.rb index f87b5251..6c5647c8 100644 --- a/rake/build/environment.rb +++ b/rake/build/environment.rb @@ -51,12 +51,10 @@ # basedir - base directory (intermediate files are copied there) # artifact_directory - directory on the main node where artifacts are copied # wheeldir - directory where wheels are prefetched (cache directory) - # st2_python - if variable is set that means that our version of python is used envpass :basedir, '/root' envpass :debug_level, 1, proc: convert_to_int envpass :artifact_dir, '/root/build' envpass :wheeldir, '/tmp/wheelhouse' - envpass :st2_python, 0, proc: convert_to_int # Default hostnames of dependat services (the value can take an address also) envpass :rabbitmqhost, 'rabbitmq', proc: convert_to_ipaddr diff --git a/rake/build/setup.rake b/rake/build/setup.rake index 6ced48a6..7a03dd6f 100644 --- a/rake/build/setup.rake +++ b/rake/build/setup.rake @@ -5,7 +5,7 @@ namespace :setup do task :all => [:install_artifacts, :configure] - task :install_artifacts => ['upload:to_testnode', :install_st2_python] do + task :install_artifacts => ['upload:to_testnode'] do pipeline do run hostname: opts[:testnode] do |opts| with opts.env do @@ -31,18 +31,4 @@ namespace :setup do end end end - - task :install_st2_python do - # Only run if we use st2_python (currently only used on el6) - if pipeopts.st2_python == 1 - pipeline do - run hostname: opts[:testnode] do |opts| - repo_path = '/etc/yum.repos.d/stackstorm-el6-stable.repo' - execute :wget, "-nv https://bintray.com/stackstorm/el6/rpm -O #{repo_path}" - execute :sed, "-ir 's~stackstorm/el6~stackstorm/el6/stable~' #{repo_path}" - execute :yum, "--nogpgcheck -y install st2python" - end - end - end - end end diff --git a/rpmspec/helpers.spec b/rpmspec/helpers.spec index 04216962..5e558023 100644 --- a/rpmspec/helpers.spec +++ b/rpmspec/helpers.spec @@ -57,12 +57,6 @@ %endif # if rhel8 %endif # st2 package version parsing -## Set macro indicating that we're using our python -# -%if %(echo ${ST2_PYTHON:-0}) == 1 - %define use_st2python 1 -%endif - # Redefine and to drop python brp bytecompile # %define __os_install_post() \ @@ -72,60 +66,32 @@ /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \ %{nil} -# Install systemd or sysv service into the package +# Install systemd service into the package # %define service_install() \ - %if 0%{?use_systemd} \ - for svc in %{?*}; do \ - install -D -p -m0644 %{SOURCE0}/rpm/$svc.service %{buildroot}%{_unitdir}/$svc.service \ - [ -f %{SOURCE0}/rpm/$svc.socket ] && install -D -p -m0644 %{SOURCE0}/rpm/$svc.socket %{buildroot}%{_unitdir}/$svc.socket \ - done \ - %else \ - for svc in %{?*}; do \ - install -D -p -m0755 %{SOURCE0}/rpm/$svc.init %{buildroot}%{_sysconfdir}/rc.d/init.d/$svc \ - done \ - %endif \ + for svc in %{?*}; do \ + install -D -p -m0644 %{SOURCE0}/rpm/$svc.service %{buildroot}%{_unitdir}/$svc.service \ + [ -f %{SOURCE0}/rpm/$svc.socket ] && install -D -p -m0644 %{SOURCE0}/rpm/$svc.socket %{buildroot}%{_unitdir}/$svc.socket \ + done \ %{nil} # Service post stage action # enables used to enforce the policy, which seems to be disabled by default # %define service_post() \ - %if 0%{?use_systemd} \ - %{expand: %systemd_post %%{?*}} \ - systemctl --no-reload enable %{?*} >/dev/null 2>&1 || : \ - %else \ - for svc in %{?*}; do \ - /sbin/chkconfig --add $svc || : \ - /sbin/chkconfig --level 2345 $svc on || : \ - done \ - %endif \ + %{expand: %systemd_post %%{?*}} \ + systemctl --no-reload enable %{?*} >/dev/null 2>&1 || : \ %{nil} # Service preun stage action # %define service_preun() \ - %if 0%{?use_systemd} \ - %{expand: %systemd_preun %%{?*}} \ - %else \ - for svc in %{?*}; do \ - /sbin/service $svc stop &>/dev/null || : \ - /sbin/chkconfig --del $svc &>/dev/null || : \ - done \ - %endif \ + %{expand: %systemd_preun %%{?*}} \ %{nil} # Service postun stage action # ($1 > 1 on package upgrade) # %define service_postun() \ - %if 0%{?use_systemd} \ - %{expand: %systemd_postun_with_restart %%{?*}} \ - %else \ - if [ $1 -ge 1 ]; then \ - for svc in %{?*}; do \ - /sbin/service $svc try-restart &>/dev/null || : \ - done \ - fi \ - %endif \ + %{expand: %systemd_postun_with_restart %%{?*}} \ %{nil} diff --git a/rpmspec/package_venv.spec b/rpmspec/package_venv.spec index e5a478e1..8a2f817e 100644 --- a/rpmspec/package_venv.spec +++ b/rpmspec/package_venv.spec @@ -27,9 +27,6 @@ # EL8 requires crypto built locally and venvctrl available outside of venv %define pip_install_venv \ - %if 0%{?use_st2python} \ - export PATH=/usr/share/python/st2python/bin:$PATH \ - %endif \ virtualenv --no-download %{venv_dir} \ %{pin_pip} \ %{install_crypto} \ diff --git a/scripts/build_python.sh b/scripts/build_python.sh deleted file mode 100644 index ac31a5e4..00000000 --- a/scripts/build_python.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -e - -build="${ST2_PYTHON}" -pyver="${ST2_PYTHON_VERSION}" -pyrel="${ST2_PYTHON_RELEASE}" -artifact_dir="${ARTIFACT_DIR}" - -if [ "$build" != "1" ]; then - echo "Python build skipped. If you want st2python package, set ST2_PYTHON to 1." - exit 0 -fi - -# create bro dirs for rpmbuild -mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} - -# grab python source -curl -sSL http://www.python.org/ftp/python/$pyver/Python-$pyver.tar.xz -o \ - ~/rpmbuild/SOURCES/Python-$pyver.tar.xz - -# invoke build -rpmbuild -bb st2python.spec - -# copy artifact -cp ~/rpmbuild/RPMS/$(arch)/st2python*-$pyver-${ST2_PYTHON_RELEASE}*.rpm ${artifact_dir} diff --git a/scripts/includes/common.sh b/scripts/includes/common.sh index 2884d92d..702401c1 100644 --- a/scripts/includes/common.sh +++ b/scripts/includes/common.sh @@ -145,9 +145,7 @@ configure_st2_user () { # to be generated again. if ! sudo test -s ${SYSTEM_HOME}/.ssh/stanley_rsa; then # added PEM to enforce PEM ssh key type in EL8 to maintain consistency - # Hotfix for EL6 which doesn't have '-m' param for ssh-keygen - # TODO: Revert once EL6 is deprecated, may need testing - sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" -m PEM || sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" + sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" -m PEM fi if ! sudo grep -s -q -f ${SYSTEM_HOME}/.ssh/stanley_rsa.pub ${SYSTEM_HOME}/.ssh/authorized_keys; diff --git a/scripts/st2bootstrap-deb.sh b/scripts/st2bootstrap-deb.sh index 766a0a4d..1b094378 100644 --- a/scripts/st2bootstrap-deb.sh +++ b/scripts/st2bootstrap-deb.sh @@ -263,9 +263,7 @@ configure_st2_user () { # to be generated again. if ! sudo test -s ${SYSTEM_HOME}/.ssh/stanley_rsa; then # added PEM to enforce PEM ssh key type in EL8 to maintain consistency - # Hotfix for EL6 which doesn't have '-m' param for ssh-keygen - # TODO: Revert once EL6 is deprecated, may need testing - sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" -m PEM || sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" + sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" -m PEM fi if ! sudo grep -s -q -f ${SYSTEM_HOME}/.ssh/stanley_rsa.pub ${SYSTEM_HOME}/.ssh/authorized_keys; diff --git a/scripts/st2bootstrap-el7.sh b/scripts/st2bootstrap-el7.sh index 909f3ef0..494180d6 100644 --- a/scripts/st2bootstrap-el7.sh +++ b/scripts/st2bootstrap-el7.sh @@ -257,9 +257,7 @@ configure_st2_user () { # to be generated again. if ! sudo test -s ${SYSTEM_HOME}/.ssh/stanley_rsa; then # added PEM to enforce PEM ssh key type in EL8 to maintain consistency - # Hotfix for EL6 which doesn't have '-m' param for ssh-keygen - # TODO: Revert once EL6 is deprecated, may need testing - sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" -m PEM || sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" + sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" -m PEM fi if ! sudo grep -s -q -f ${SYSTEM_HOME}/.ssh/stanley_rsa.pub ${SYSTEM_HOME}/.ssh/authorized_keys; diff --git a/scripts/st2bootstrap-el8.sh b/scripts/st2bootstrap-el8.sh index 13501d1a..4eded295 100644 --- a/scripts/st2bootstrap-el8.sh +++ b/scripts/st2bootstrap-el8.sh @@ -260,9 +260,7 @@ configure_st2_user () { # to be generated again. if ! sudo test -s ${SYSTEM_HOME}/.ssh/stanley_rsa; then # added PEM to enforce PEM ssh key type in EL8 to maintain consistency - # Hotfix for EL6 which doesn't have '-m' param for ssh-keygen - # TODO: Revert once EL6 is deprecated, may need testing - sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" -m PEM || sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" + sudo ssh-keygen -f ${SYSTEM_HOME}/.ssh/stanley_rsa -P "" -m PEM fi if ! sudo grep -s -q -f ${SYSTEM_HOME}/.ssh/stanley_rsa.pub ${SYSTEM_HOME}/.ssh/authorized_keys;