1

Topic: initctl: invalid command: reopen-logs (fix?)

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version: 0.90
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): both - or so it seems
- Linux/BSD distribution name and version: Ubuntu 14.04 LTS
- Related log if you're reporting an issue: /etc/cron.daily/logrotate
====

ERROR MESSAGE
/etc/cron.daily/logrotate:
Stopping iredapd ...
Starting iredapd ...

//relevant section//
initctl: invalid command: reopen-logs
Try `initctl --help' for more information.
invoke-rc.d: initscript php5-fpm, action "reopen-logs" failed.
error: error running non-shared postrotate script for /var/log/php5-fpm.log of '/var/log/php5-fpm.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1
/etc/cron.daily/tmpreaper:
Please read /usr/share/doc/tmpreaper/README.security.gz first;
edit /etc/tmpreaper.conf to remove this message (look for SHOWWARNING).
//end//

So the issue is "reopen-logs. Looking at the script
/etc/logrotate.d/php5-fpm

We see:

/var/log/php5-fpm.log {
        rotate 12
        weekly
        missingok
        notifempty
        compress
        delaycompress
        postrotate
                invoke-rc.d php5-fpm reopen-logs > /dev/null
        endscript
}

I suggest the fix is to change 'reopen-logs' to 'restart'. It suppressed warning emails on my system.
Can anyone concur, OR suggest a different workaround?

Regards,

/.Mangler

----

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

2

Re: initctl: invalid command: reopen-logs (fix?)

Try
/usr/lib/php5/php5-fpm-reopenlogs

3

Re: initctl: invalid command: reopen-logs (fix?)

7t3chguy wrote:

Try
/usr/lib/php5/php5-fpm-reopenlogs

Aha, didn't see that possibility when looking at possible other commands. Good suggestion & duly edited. Will report back if the error notification returns - or else will mark thread solved.

Many thanks!

/.Mangler

4

Re: initctl: invalid command: reopen-logs (fix?)

Its what my logrotate php5-fpm file contained, no idea why mine/yours are different, maybe ppa:ondrej/php5-5.6 contains an updated version of the logrotate.d config file.

Edit: just checked dpkg and it seems that the ppa does include a different version of the logrotate conf

5

Re: initctl: invalid command: reopen-logs (fix?)

file /etc/logrotate.d/php5-fpm is generated by php5-fpm package. If you installed php5-fpm from official Ubuntu apt repo, please report this bug to package maintainer.

6 (edited by WurstMangler 2015-03-30 17:56:24)

Re: initctl: invalid command: reopen-logs (fix?)

ZhangHuangbin wrote:

file /etc/logrotate.d/php5-fpm is generated by php5-fpm package. If you installed php5-fpm from official Ubuntu apt repo, please report this bug to package maintainer.

It was installed by iRedMail, so indeed I think it's safe to assume it's from a/the official Ubuntu repo.

./Mangler

7

Re: initctl: invalid command: reopen-logs (fix?)

WurstMangler wrote:

It was installed by iRedMail, so indeed I think it's safe to assume it's from a/the official Ubuntu repo.

Please report this issue to package maintainer, so that it won't happen in new version.