From f8755940fde8319b032acd8cfdb67c6c855ab846 Mon Sep 17 00:00:00 2001 From: blsaws Date: Tue, 24 May 2016 08:42:18 -0700 Subject: Add systemd control for congress JIRA: COPPER-2 Change-Id: I10ecb0d02ddb5fa83d8b52210f68b627e81dcaeb Signed-off-by: blsaws --- .../congress/install/bash/install_congress_1.sh | 2 +- .../congress/install/bash/install_congress_2.sh | 28 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'components') diff --git a/components/congress/install/bash/install_congress_1.sh b/components/congress/install/bash/install_congress_1.sh index 423e887..d8d05a1 100644 --- a/components/congress/install/bash/install_congress_1.sh +++ b/components/congress/install/bash/install_congress_1.sh @@ -198,7 +198,7 @@ ssh -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $CTLUSER@$CON echo "Wait 30 seconds for Congress service to startup" sleep 30 - +Creates and activates a virtualenv environment for Congress in the repo clone, to avoid messing up the Jumphost echo "Create data sources" # To remove datasources: openstack congress datasource delete openstack congress datasource create nova "nova" \ diff --git a/components/congress/install/bash/install_congress_2.sh b/components/congress/install/bash/install_congress_2.sh index 580b603..17b6475 100644 --- a/components/congress/install/bash/install_congress_2.sh +++ b/components/congress/install/bash/install_congress_2.sh @@ -154,6 +154,34 @@ pip install . echo "Install python fixtures" pip install fixtures +echo "Setup congress-server in init.d" +cat > /tmp/congress-server << EOC +#!/bin/bash +source ~/congress/venv/bin/activate +~/congress/congress/bin/congress-server &>/dev/null +EOC +sudo mv /tmp/congress-server /etc/init.d/congress-server + +echo "Setup systemd service" +cat > /tmp/openstack-congress.service << EOC +[Unit] +Description=OpenStack Congress Server +After=syslog.target network.target +[Service] +Type=notify +NotifyAccess=all +TimeoutStartSec=0 +Restart=always +User=root +ExecStart=/etc/init.d/congress-server start +ExecStop=/etc/init.d/congress-server stop +[Install] +WantedBy=multi-user.target +EOC +sudo mv /tmp/openstack-congress.service /usr/lib/systemd/system/openstack-congress.service +chmod 644 /usr/lib/systemd/system/openstack-congress.service +sudo systemctl daemon-reload + # TODO: The rest of this script is not yet tested function _congress_setup_horizon { local HORIZON_DIR="/usr/share/openstack-dashboard" -- cgit 1.2.3-korg