Only restart prosody if the daemon isn't running
This commit is contained in:
parent
875bb191e7
commit
b8eaf17ee0
|
@ -414,10 +414,16 @@ function prosody_daemon_restart_script {
|
|||
# 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
|
||||
if [ ! -f /etc/cron.daily/prosody ]; then
|
||||
echo '#!/bin/bash' > /etc/cron.daily/prosody
|
||||
echo 'systemctl restart prosody' >> /etc/cron.daily/prosody
|
||||
chmod +x /etc/cron.daily/prosody
|
||||
if [ -f /etc/cron.daily/prosody ]; then
|
||||
rm /etc/cron.daily/prosody
|
||||
fi
|
||||
if [ ! -f /etc/cron.hourly/prosody ]; then
|
||||
{ '#!/bin/bash';
|
||||
"is_active=\$(systemctl is-active prosody)";
|
||||
"if [[ \"\$is_active\" != 'active' ]]; then";
|
||||
' systemctl restart prosody'
|
||||
'fi'; } > /etc/cron.hourly/prosody
|
||||
chmod +x /etc/cron.hourly/prosody
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue