====== imjournal stops logging due to corrupt state file ======
===== Symptoms =====
On a 5209 server, no messages are written to /var/log/messages and other log files other than stop / start of the rsyslog daemon, and one other message.
Apr 15 16:39:39 hostname rsyslogd-3000: sd_journal_get_cursor() failed: 'Cannot assign requested address'
===== Cause =====
The root cause of this problem is a known bug in systemd. For further details, see the link below.
* https://bugzilla.redhat.com/show_bug.cgi?id=1088021
===== Resolution =====
The bash script below will detect the invalid state of the syslog service, and restart it if required.
#!/bin/bash
if [ `lsof -c rsyslogd | grep -c var.log` -eq 1 ]; then
service rsyslog stop
rm /var/lib/rsyslog/imjournal.state
service rsyslog start
fi
To make this automatic, you can add a cron task to call this script regularly
# Check syslog every 5 minutes, and restart it if required
*/5 * * * * root /usr/sausalito/sbin/fix_syslog.sh > /dev/null 2>&1
===== Properties =====
* rsyslogd
* /var/log/messages
* 5209R
===== Patched =====
The above fix has been pushed out as a patch to Blueonyx 5209R on 28-Apr-2016