From 50408559bd19807edb236fd7731a87915280852d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 20 Dec 2017 13:33:36 +0000 Subject: [PATCH] Ensure that if prosody gets stuck it will unstick itself at least once per day --- src/freedombone-app-xmpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index b57b6885..d52f9f7b 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -544,6 +544,7 @@ function remove_xmpp { remove_onion_service xmpp 5222 5223 5269 apt-get -yq remove --purge prosody + rm /etc/cron.daily/prosody if [ -f $INSTALL_DIR/$prosody_modules_filename ]; then rm $INSTALL_DIR/$prosody_modules_filename fi @@ -1059,6 +1060,13 @@ function install_xmpp { exit 347682 fi + # On rare occasions the daemon appears to get stuck + # i.e. still active, but not accepting connections + # This ensures that it will unstick itself at least once per day + echo '#!/bin/bash' > /etc/cron.daily/prosody + echo 'systemctl restart prosody' >> /etc/cron.daily/prosody + chmod +x /etc/cron.daily/prosody + ${PROJECT_NAME}-pass -u $MY_USERNAME -a xmpp -p "$XMPP_PASSWORD" APP_INSTALLED=1