From afe945c3777df8e5706ede72357999836734c8d8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 14 May 2017 22:46:15 +0100 Subject: [PATCH] Stop and restart prosody when modules are updated to avoid undefined behavior --- src/freedombone-app-xmpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index 5abdf6a5..c493c939 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -319,8 +319,10 @@ function update_prosody_modules { fi tar -xzvf $prosody_modules_filename if [ -d prosody-modules ]; then + systemctl stop prosody cp -r prosody-modules/* /var/lib/prosody/prosody-modules chown -R prosody:prosody /var/lib/prosody/prosody-modules + systemctl start prosody fi fi fi @@ -328,10 +330,14 @@ function update_prosody_modules { # change to using pep rather than profile modules if grep '"profile"' /etc/prosody/prosody.cfg.lua; then + systemctl stop prosody sed -i 's|"profile"|"pep"|g' /etc/prosody/prosody.cfg.lua + systemctl start prosody fi if ! grep '"vcard"' /etc/prosody/prosody.cfg.lua; then + systemctl stop prosody sed -i '/"pep"/a "vcard";' /etc/prosody/prosody.cfg.lua + systemctl start prosody fi }