summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblsaws <bryan.sullivan@att.com>2016-05-24 08:42:18 -0700
committerblsaws <bryan.sullivan@att.com>2016-05-24 08:42:18 -0700
commitf8755940fde8319b032acd8cfdb67c6c855ab846 (patch)
treeecf40bc29f03c92b1be6c0caeb1321d545c19670
parentaf083995bda454ed9bda6629fadabcb41efcf1c3 (diff)
Add systemd control for congress
JIRA: COPPER-2 Change-Id: I10ecb0d02ddb5fa83d8b52210f68b627e81dcaeb Signed-off-by: blsaws <bryan.sullivan@att.com>
-rw-r--r--components/congress/install/bash/install_congress_1.sh2
-rw-r--r--components/congress/install/bash/install_congress_2.sh28
2 files changed, 29 insertions, 1 deletions
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 <name>
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"