• Spider Email Archiver : Lightweight on-premises email archiving software, developed by iRedMail team.
  • Join our Telegram group (@iredmail_chat) to get help from other iRedMail users.
  • Topic: [RESOLVED] Job for rsyslog.service failed

    ==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
    - iRedMail version (check /etc/iredmail-release): 0.9.9
    - Deployed with iRedMail Easy or the downloadable installer? Downloadable installer
    - Linux/BSD distribution name and version: Debian 9.8.0
    - Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
    - 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.
    ====

    Hi, once in a week, on Sunday, I receive a letter to postmaster with the following:

    /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/php-fpm/php-fpm.log of '/var/log/php-fpm/*.log '
    run-parts: /etc/cron.daily/logrotate exited with return code 1

    It seems that this error occurs when creating a backup copy and after it the file mail.log and some other logs are not written - they are empty.

    The command "systemctl status rsyslog.service" returns "failed"

    After restarting the server, the logs begin to fill up again. Please help me solve the problem.

    Same problem was here: https://forum.iredmail.org/topic15770-r … ailed.html

    Spider Email Archiver : On-Premises, lightweight email archiving software developed by iRedMail team. Stable release is out.

    Re: [RESOLVED] Job for rsyslog.service failed

    can you share content of /etc/logrotate.d/php7.0-fpm

    I can't recall but I think I might have needed to add "sharedscripts" to the config
    eg:

    /var/log/php-fpm/*.log {
    weekly
    rotate 10
    missingok
    compress
    delaycompress
    notifempty
    sharedscripts
    postrotate
    /usr/sbin/service rsyslog restart
    endscript
    }

    Re: [RESOLVED] Job for rsyslog.service failed

    MuPp3t33r wrote:

    can you share content of /etc/logrotate.d/php7.0-fpm

    Here it is:

    /var/log/php-fpm/*.log {
    weekly
    rotate 10
    missingok
    compress
    delaycompress
    notifempty

    postrotate
    /usr/sbin/service rsyslog restart
    endscript
    }

    I will try to add "sharedscripts" and see what happens on Sunday. Thanks

    Re: [RESOLVED] Job for rsyslog.service failed

    ZhangHuangbin wrote:

    Adding "sharedscripts" in the rsyslog config file should fix the issue.

    Hello again. Adding "sharedscripts" to /etc/logrotate.d/php7.0-fpm did not solve the problem. On Sunday, the following logs in var/logs/ were empty again:

    auth.log
    daemon.log
    debug
    fail2ban.log
    kern.log
    lpr.log
    mail.log
    messages
    syslog
    user.log

    And this is the output of "systemctl status rsyslog.service":

    root@SRV-REG-MAIL35-1:/home/web# systemctl status rsyslog.service
    ? rsyslog.service - System Logging Service
    Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
    Active: failed (Result: start-limit-hit) since Sun 2020-02-02 06:33:27 EET; 5h 34min ago
    Docs: man:rsyslogd(8)
    http://www.rsyslog.com/doc/
    Process: 26339 ExecStart=/usr/sbin/rsyslogd -n (code=exited, status=0/SUCCESS)
    Main PID: 26339 (code=exited, status=0/SUCCESS)

    Feb 02 06:33:26 SRV-REG-MAIL35-1 systemd[1]: Starting System Logging Service...
    Feb 02 06:33:26 SRV-REG-MAIL35-1 liblogging-stdlog[26339]:  [origin software="rsyslogd" swVersion="8.24.0" x-pid="26339" x-info="http://www.rsyslog.com"] start
    Feb 02 06:33:26 SRV-REG-MAIL35-1 systemd[1]: Started System Logging Service.
    Feb 02 06:33:27 SRV-REG-MAIL35-1 systemd[1]: Stopping System Logging Service...
    Feb 02 06:33:27 SRV-REG-MAIL35-1 liblogging-stdlog[26339]:  [origin software="rsyslogd" swVersion="8.24.0" x-pid="26339" x-info="http://www.rsyslog.com"] exiting on signal 15.
    Feb 02 06:33:27 SRV-REG-MAIL35-1 systemd[1]: Stopped System Logging Service.
    Feb 02 06:33:27 SRV-REG-MAIL35-1 systemd[1]: rsyslog.service: Start request repeated too quickly.
    Feb 02 06:33:27 SRV-REG-MAIL35-1 systemd[1]: Failed to start System Logging Service.
    Feb 02 06:33:27 SRV-REG-MAIL35-1 systemd[1]: rsyslog.service: Unit entered failed state.
    Feb 02 06:33:27 SRV-REG-MAIL35-1 systemd[1]: rsyslog.service: Failed with result 'start-limit-hit'.

    Maybe I should add "sharedscripts" to some other files too? Thanks

    Re: [RESOLVED] Job for rsyslog.service failed

    ZhangHuangbin wrote:

    Check all files under /etc/logrotate.d/, if the "postrotate" command restarts rsyslog service, then add "sharedscripts" in that file.

    Been struggling with trying to fix this for a while. Will give this try.

    FAI an easy way to identify in which files postrotate restarts rsyslog is:

    grep -r /etc/logrotate.d -e 'rsyslog restart'

    which for me outputs:

    /etc/logrotate.d/iredapd:        /usr/sbin/service rsyslog restart
    /etc/logrotate.d/mlmmjadmin:        /usr/sbin/service rsyslog restart
    /etc/logrotate.d/php7.2-fpm:        /usr/sbin/service rsyslog restart
    /etc/logrotate.d/dovecot:        /usr/sbin/service rsyslog restart

    Generated in 0.007 seconds (63% PHP - 37% DB) with 8 queries