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

2

Re: rsyslog problem

/etc/logrotate*

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

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

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

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/

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee