]> git.aero2k.de Git - urlbot-v3.git/commitdiff
fix deployment, make sure rabbitmq is up
authorThorsten <mail@aero2k.de>
Thu, 12 Mar 2020 15:26:57 +0000 (16:26 +0100)
committerThorsten <mail@aero2k.de>
Thu, 12 Mar 2020 15:32:21 +0000 (16:32 +0100)
deploy/roles/urlbot/templates/urlbot-chat.service
deploy/roles/urlbot/templates/urlbot-worker.service
deploy/roles/urlbot/templates/wait-for-rabbitmq.sh [new file with mode: 0644]

index eb037de5cf80842cfb451b3aa7d1323b1d18cf34..b2eaef919a2375dcd3b89da1aa2d3bd6dc50ddf6 100644 (file)
@@ -2,6 +2,7 @@
 Description=jabber bot entertaining and supporting activity on jabber MUCs
 
 [Service]
+ExecStartPre=/home/{{ botuser }}/wait-for-rabbitmq.sh
 ExecStart={{ venv_chatbot }}/bin/urlbotd-chat
 WorkingDirectory=/home/{{ botuser }}/urlbot-v3/
 StandardOutput=journal+console
@@ -9,4 +10,4 @@ StandardError=journal+console
 Restart=always
 
 [Install]
-WantedBy=multi-user.target
+WantedBy=default.target
index 67639eb9f42c31caba9d154cbeadb6664393087d..a035685b5f80050ca156ab8fe20864b9e9c5da42 100644 (file)
@@ -2,6 +2,7 @@
 Description=jabber bot entertaining and supporting activity on jabber MUCs
 
 [Service]
+ExecStartPre=/home/{{ botuser }}/wait-for-rabbitmq.sh
 ExecStart={{ venv_worker }}/bin/urlbotd-worker
 WorkingDirectory=/home/{{ botuser }}/urlbot-v3/
 StandardOutput=journal+console
@@ -9,4 +10,4 @@ StandardError=journal+console
 Restart=always
 
 [Install]
-WantedBy=multi-user.target
+WantedBy=default.target
diff --git a/deploy/roles/urlbot/templates/wait-for-rabbitmq.sh b/deploy/roles/urlbot/templates/wait-for-rabbitmq.sh
new file mode 100644 (file)
index 0000000..59d65ba
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# TODO: parse amqp_uri, insert here
+while ! echo > /dev/tcp/localhost/5672; do
+        echo "waiting for remote service..."
+        sleep 5s
+done