diff --git a/openstack/rabbitmq-server-config/centos/build_srpm.data b/openstack/rabbitmq-server-config/centos/build_srpm.data deleted file mode 100644 index da1e20bd..00000000 --- a/openstack/rabbitmq-server-config/centos/build_srpm.data +++ /dev/null @@ -1,2 +0,0 @@ -SRC_DIR="files" -TIS_PATCH_VER=0 diff --git a/openstack/rabbitmq-server-config/centos/rabbitmq-server-config.spec b/openstack/rabbitmq-server-config/centos/rabbitmq-server-config.spec deleted file mode 100644 index ff438f71..00000000 --- a/openstack/rabbitmq-server-config/centos/rabbitmq-server-config.spec +++ /dev/null @@ -1,47 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# -# Copyright (C) 2019 Intel Corporation -# -Summary: rabbitmq-server-config -Name: rabbitmq-server-config -Version: 1.0 -Release: %{tis_patch_ver}%{?_tis_dist} -License: Apache-2.0 -Group: base -Packager: StarlingX -URL: unknown -BuildArch: noarch -Source: %name-%version.tar.gz - -Requires: %{_bindir}/systemctl -Requires: rabbitmq-server -Summary: package StarlingX configuration files of rabbitmq-server to system folder. - -%description -package StarlingX configuration files of rabbitmq-server to system folder. - -%prep -%setup - -%build - -%install -%{__install} -d %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq -%{__install} -d %{buildroot}%{_sysconfdir}/systemd/system -%{__install} -d %{buildroot}%{_datadir}/starlingx - -%{__install} -m 0755 rabbitmq-server.ocf %{buildroot}%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/stx.rabbitmq-server -%{__install} -m 0644 rabbitmq-server.service.example %{buildroot}%{_sysconfdir}/systemd/system/rabbitmq-server.service -%{__install} -m 0644 rabbitmq-server.logrotate %{buildroot}%{_datadir}/starlingx/stx.rabbitmq-server.logrotate - -%post -if [ $1 -eq 1 ] ; then - # Initial installation - cp -f %{_datadir}/starlingx/stx.rabbitmq-server.logrotate %{_sysconfdir}/logrotate.d/rabbitmq-server -fi - -%files -%{_exec_prefix}/lib/ocf/resource.d/rabbitmq/stx.rabbitmq-server -%{_sysconfdir}/systemd/system/rabbitmq-server.service -%{_datadir}/starlingx/stx.rabbitmq-server.logrotate diff --git a/openstack/rabbitmq-server-config/files/rabbitmq-server.logrotate b/openstack/rabbitmq-server-config/files/rabbitmq-server.logrotate deleted file mode 100644 index 4c8f3b01..00000000 --- a/openstack/rabbitmq-server-config/files/rabbitmq-server.logrotate +++ /dev/null @@ -1,13 +0,0 @@ -/var/log/rabbitmq/*.log { - weekly - missingok - rotate 20 - compress - delaycompress - notifempty - sharedscripts - postrotate - pgrep beam.smp >/dev/null && /usr/sbin/rabbitmqctl -q rotate_logs - true - endscript -} diff --git a/openstack/rabbitmq-server-config/files/rabbitmq-server.ocf b/openstack/rabbitmq-server-config/files/rabbitmq-server.ocf deleted file mode 100644 index db824f8d..00000000 --- a/openstack/rabbitmq-server-config/files/rabbitmq-server.ocf +++ /dev/null @@ -1,423 +0,0 @@ -#!/bin/sh -## The contents of this file are subject to the Mozilla Public License -## Version 1.1 (the "License"); you may not use this file except in -## compliance with the License. You may obtain a copy of the License -## at http://www.mozilla.org/MPL/ -## -## Software distributed under the License is distributed on an "AS IS" -## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -## the License for the specific language governing rights and -## limitations under the License. -## -## The Original Code is RabbitMQ. -## -## The Initial Developer of the Original Code is VMware, Inc. -## Copyright (c) 2007-2013 VMware, Inc. All rights reserved. -## - -## -## OCF Resource Agent compliant rabbitmq-server resource script. -## - -## OCF instance parameters -## OCF_RESKEY_server -## OCF_RESKEY_ctl -## OCF_RESKEY_nodename -## OCF_RESKEY_ip -## OCF_RESKEY_port -## OCF_RESKEY_config_file -## OCF_RESKEY_log_base -## OCF_RESKEY_mnesia_base -## OCF_RESKEY_server_start_args -## OCF_RESKEY_pid_file -## WRS -# OCF_RESKEY_env_config_file -# OCF_RESKEY_dist_port - -####################################################################### -# Initialization: - -: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat} -. ${OCF_FUNCTIONS_DIR}/.ocf-shellfuncs - -####################################################################### - -. /etc/platform/platform.conf - -OCF_RESKEY_server_default="/usr/sbin/rabbitmq-server" -OCF_RESKEY_ctl_default="/usr/sbin/rabbitmqctl" -OCF_RESKEY_nodename_default="rabbit@localhost" -OCF_RESKEY_log_base_default="/var/log/rabbitmq" -OCF_RESKEY_pid_file_default="/var/run/rabbitmq/pid" -: ${OCF_RESKEY_server=${OCF_RESKEY_server_default}} -: ${OCF_RESKEY_ctl=${OCF_RESKEY_ctl_default}} -: ${OCF_RESKEY_nodename=${OCF_RESKEY_nodename_default}} -: ${OCF_RESKEY_log_base=${OCF_RESKEY_log_base_default}} -: ${OCF_RESKEY_pid_file=${OCF_RESKEY_pid_file_default}} - -meta_data() { - cat < - - -1.0 - - -Resource agent for RabbitMQ-server - - -Resource agent for RabbitMQ-server - - - - -The path to the rabbitmq-server script - -Path to rabbitmq-server - - - - - -The path to the rabbitmqctl script - -Path to rabbitmqctl - - - - - -The node name for rabbitmq-server - -Node name - - - - - -The IP address for rabbitmq-server to listen on - -IP Address - - - - - -The IP Port for rabbitmq-server to listen on - -IP Port - - - - - -Location of the config file (without the .config suffix) - -Config file path (without the .config suffix) - - - - - -Location of the directory under which logs will be created - -Log base path - - - - - -Location of the directory under which mnesia will store data - -Mnesia base path - - - - - -Additional arguments provided to the server on startup - -Server start arguments - - - - - -Location of the file in which the pid will be stored - -Pid file path - - - - - - - - - - - - - - -END -} - -rabbit_usage() { - cat < /dev/null 2> /dev/null - rc=$? - case "$rc" in - 0) - ocf_log debug "RabbitMQ server is running normally" - return $OCF_SUCCESS - ;; - 2) - ocf_log debug "RabbitMQ server is not running" - return $OCF_NOT_RUNNING - ;; - *) - ocf_log err "Unexpected return from rabbitmqctl $NODENAME_ARG $action: $rc" - exit $OCF_ERR_GENERIC - esac -} - -rabbit_start() { - local rc - - if rabbit_status; then - ocf_log info "Resource already running." - return $OCF_SUCCESS - fi - - export_vars - - # Increase the maximum number of file descriptors that can be open at - # once - required for large systems. - ulimit -n 8192 - if [ "${system_type}" = "All-in-one" ]; then - # Rabbit/beam related tasks should be on platform cores from the get go. - # If they are affined to all cores during initialization sequence of AIO, - # the system will end up with many extra beam threads that are not in use. - source /etc/init.d/cpumap_functions.sh - PLATFORM_CPULIST=$(platform_expanded_cpu_list) - PLATFORM_CPUS=$(get_platform_cpus) - # Calculate thread pool size based on PLATFORM_CPUS - # Refer to: https://github.com/rabbitmq/rabbitmq-common/commit/4f9ef33cf9ba52197ff210ffcdf6629c1b7a6e9e - RABBITMQ_IO_THREAD_POOL_SIZE=$((${PLATFORM_CPUS} * 16)) - if [ ${RABBITMQ_IO_THREAD_POOL_SIZE} -lt 64 ]; then - RABBITMQ_IO_THREAD_POOL_SIZE=64 - elif [ ${RABBITMQ_IO_THREAD_POOL_SIZE} -gt 1024 ]; then - RABBITMQ_IO_THREAD_POOL_SIZE=1024 - fi - export RABBITMQ_IO_THREAD_POOL_SIZE - setsid sh -c "exec taskset -c ${PLATFORM_CPULIST} $RABBITMQ_SERVER >> ${RABBITMQ_LOG_BASE}/startup_log 2>> ${RABBITMQ_LOG_BASE}/startup_err" & - else - setsid sh -c "$RABBITMQ_SERVER >> ${RABBITMQ_LOG_BASE}/startup_log 2>> ${RABBITMQ_LOG_BASE}/startup_err" & - fi - - # Wait for the server to come up. - # Let the CRM/LRM time us out if required - rabbit_wait $RABBITMQ_PID_FILE - rc=$? - if [ "$rc" != $OCF_SUCCESS ]; then - remove_pid - ocf_log info "rabbitmq-server start failed: $rc" - exit $OCF_ERR_GENERIC - fi - - return $OCF_SUCCESS -} - -rabbit_stop() { - local rc - - if ! rabbit_status; then - ocf_log info "Resource not running." - return $OCF_SUCCESS - fi - - $RABBITMQ_CTL stop - rc=$? - - if [ "$rc" != 0 ]; then - ocf_log err "rabbitmq-server stop command failed: $RABBITMQ_CTL stop, $rc" - return $rc - fi - - # Spin waiting for the server to shut down. - # Let the CRM/LRM time us out if required - stop_wait=1 - while [ $stop_wait = 1 ]; do - rabbit_status - rc=$? - if [ "$rc" = $OCF_NOT_RUNNING ]; then - remove_pid - stop_wait=0 - break - elif [ "$rc" != $OCF_SUCCESS ]; then - ocf_log info "rabbitmq-server stop failed: $rc" - exit $OCF_ERR_GENERIC - fi - sleep 1 - done - - return $OCF_SUCCESS -} - -rabbit_monitor() { - rabbit_status - return $? -} - -case $__OCF_ACTION in - meta-data) - meta_data - exit $OCF_SUCCESS - ;; - usage|help) - rabbit_usage - exit $OCF_SUCCESS - ;; -esac - -if ocf_is_probe; then - rabbit_validate_partial -else - rabbit_validate_full -fi - -export_vars - -case $__OCF_ACTION in - start) - rabbit_start - ;; - stop) - rabbit_stop - ;; - status|monitor) - rabbit_monitor - ;; - validate-all) - exit $OCF_SUCCESS - ;; - *) - rabbit_usage - exit $OCF_ERR_UNIMPLEMENTED - ;; -esac - -exit $? diff --git a/openstack/rabbitmq-server-config/files/rabbitmq-server.service.example b/openstack/rabbitmq-server-config/files/rabbitmq-server.service.example deleted file mode 100644 index 92aa2311..00000000 --- a/openstack/rabbitmq-server-config/files/rabbitmq-server.service.example +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=RabbitMQ broker -After=network.target epmd@0.0.0.0.socket -Wants=network.target epmd@0.0.0.0.socket - -[Service] -Type=notify -User=root -Group=root -NotifyAccess=all -TimeoutStartSec=3600 -WorkingDirectory=/var/lib/rabbitmq -ExecStart=/usr/lib/rabbitmq/bin/rabbitmq-server -ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctl stop - -[Install] -WantedBy=multi-user.target