BytemarkHosting / symbiosis

A hosting environment that works with you, not against you.
GNU General Public License v2.0
21 stars 14 forks source link

Logrotate cron error for prosody when it's not running #131

Closed andrewladlow closed 5 years ago

andrewladlow commented 6 years ago

The logrotate cron will email the following warning every week if prosody isn't active:

/etc/cron.daily/logrotate:
error: error running shared postrotate script for
'/var/log/prosody/prosody.log /var/log/prosody/prosody.err '
run-parts: /etc/cron.daily/logrotate exited with return code 1

It looks like this is because the postrotate tries to check for the existence of /var/run/prosody/prosody.pid which won't be there when prosody is disabled (by default):

[ -e /var/run/prosody/prosody.pid ] && /etc/init.d/prosody reload > /dev/null

We should be able to suppress that by changing this line to e.g

/etc/init.d/prosody reload > /dev/null
ianeiloart commented 6 years ago

This is a bit of a hack. Suppressing output might make real errors. A better fix is to fix this such that the post rotate script checks that the service is enabled before attempting the reload.