1

Topic: rsyslog problem

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version: Devian 9
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello,
I have a rsyslog problem.
Seems after the log rotation, the rsyslog service doesn't restart proprely. I have to type 'service rsyslog restart' to have mail.log working again.
Where can I find where the log rotation is configured ?

Thanks
Nicolas

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: rsyslog problem

/etc/logrotate*

3

Re: rsyslog problem

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):  0.9.9 OPENLDAP edition
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version:  Debian 9.9
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I've been having a similar problem on and off. I can't find anything in the log files. The only thing I get when it fails to restart is the email below.

Background: I run iredmail in a Debian LXC container. I'm not sure if that has anything to do with it.

My temporary solution is to run a cron job around 8am to check if rsyslogd is running. If it is not start it.

/etc/cron.daily/logrotate:
Job for rsyslog.service failed.
See "systemctl status rsyslog.service" and "journalctl -xe" for details.
error: error running non-shared postrotate script for /var/log/openldap/openldap.log of '/var/log/openldap/openldap.log '
Job for rsyslog.service failed.
See "systemctl status rsyslog.service" and "journalctl -xe" for details.
error: error running non-shared postrotate script for /var/log/php-fpm/php-fpm.log of '/var/log/php-fpm/*.log '
Job for rsyslog.service failed.
See "systemctl status rsyslog.service" and "journalctl -xe" for details.
run-parts: /etc/cron.daily/logrotate exited with return code 1

4

Re: rsyslog problem

I think it's a bug of postrotate command used in /etc/logrotate.d/*. iRedMail uses 'service rsyslog restart' for postrotate, it might be better to use this on Debian/Ubuntu:

postrotate
    invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
endscript

5

Re: rsyslog problem

Mr Zhang,

Thanks for the suggestion. I've changed the /etc/logrotate.d/rsyslog to

postrotate
        /usr/sbin/service syslog restart
endscript

6 (edited by nicolasfo 2019-07-16 18:22:55)

Re: rsyslog problem

ZhangHuangbin wrote:

I think it's a bug of postrotate command used in /etc/logrotate.d/*. iRedMail uses 'service rsyslog restart' for postrotate, it might be better to use this on Debian/Ubuntu:

postrotate
    invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
endscript

Hello,
I don't understand in wich file the replacement has to be done ?
Thanks
Nicolas

7

Re: rsyslog problem

nicolasfo wrote:

I don't understand in wich file the replacement has to be done ?

In files under /etc/logrotate.d/

8

Re: rsyslog problem

FYI. Still having the failure. I've upgraded rsyslogd to 8.1901.0 from backports. It's been running for nearly a week now and hasn't failed.