summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-07-22 17:15:16 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-07-22 17:15:40 +0200
commit25d4879815125aab2e80dbc75ce1ba1deb2106c6 (patch)
tree1d05aebb9435a6f302a247206cf7a7622c2b6b8d /install
parent4a35073f6e4239e52da931d314e691d624111926 (diff)
downloadIshtar-25d4879815125aab2e80dbc75ce1ba1deb2106c6.tar.bz2
Ishtar-25d4879815125aab2e80dbc75ce1ba1deb2106c6.zip
Monit template for celery
Diffstat (limited to 'install')
-rwxr-xr-xinstall/ishtar-install1
-rwxr-xr-xinstall/ishtar-prepare-instance20
-rw-r--r--install/monit.template5
3 files changed, 26 insertions, 0 deletions
diff --git a/install/ishtar-install b/install/ishtar-install
index 050e340a8..97e1b02c6 100755
--- a/install/ishtar-install
+++ b/install/ishtar-install
@@ -492,6 +492,7 @@ EOF
mkdir -p /var/log/celery/
mkdir -p /var/run/celery/
chown www-data:www-data /var/log/celery/ /var/run/celery/
+ mkdir -p /etc/monit/conf-available/
fi
echo "-------------------------------------------------------------------------------";
diff --git a/install/ishtar-prepare-instance b/install/ishtar-prepare-instance
index bd235d5a2..59aa2f0e2 100755
--- a/install/ishtar-prepare-instance
+++ b/install/ishtar-prepare-instance
@@ -279,6 +279,9 @@ EOF
sed -s "s|example_project|$INSTANCE|g;" \
$INSTANCE"/celery_app.py.sample" > \
$INSTANCE"/celery_app.py"
+ sed -s "s|#APP_NAME#|$INSTANCE|g;" \
+ "install/monit.template" > \
+ "/etc/monit/conf-available/celery-"$INSTANCE
systemctl daemon-reload
fi
@@ -411,6 +414,23 @@ EOF
echo ""
echo " And then enjoy ishtar!"
echo ""
+
+ if [ -v USE_CELERY ]; then
+ cat >&2 <<-'EOF'
+
+ If you use monit a configuration file has been generated for the celery
+ daemon:
+EOF
+ cecho g "/etc/monit/conf-available/celery-"$INSTANCE
+ cat >&2 <<-'EOF'
+
+ To activate it:
+EOF
+ cecho y "ln -s /etc/monit/conf-available/celery-"$INSTANCE" \\"
+ cecho y " /etc/monit/conf-enabled/celery-"$INSTANCE
+ cecho y "systemctl restart monit"
+ fi
+
}
do_install_instance
diff --git a/install/monit.template b/install/monit.template
new file mode 100644
index 000000000..a791927f5
--- /dev/null
+++ b/install/monit.template
@@ -0,0 +1,5 @@
+check program celery-#APP_NAME# with path "/bin/systemctl --quiet is-active celery-#APP_NAME#"
+ start program "/bin/systemctl --quiet start celery-#APP_NAME#"
+ stop program "/bin/systemctl --quiet stop celery-#APP_NAME#"
+ if status != 0 then restart
+ if 5 restarts within 5 cycles then timeout