Found a simple fix for this error in my Ubuntu Server 14.04 cron logs arising from one of the logrotate scripts:-
/etc/cron.daily/logrotate:
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
This comes from /etc/logrotate.d/php5-fpm :-
/var/log/php5-fpm.log {
rotate 12
weekly
missingok
notifempty
compress
delaycompress
postrotate
invoke-rc.d php5-fpm reopen-logs > /dev/null
endscript
}
The problem is that the php5-fpm init script doesn't have a parameter 'reopen-logs'.
So the simple fix is to change 'reopen-logs' to 'restart'.
Presumably this is an error in the php5-fpm package, i.e. the installation script has set up a logrotate entry that calls their package with an invalid argument. Easily fixed anyway.
Sunday, 24 August 2014
FIXED: Ubuntu Server cron error message: invoke-rc.d: initscript php5-fpm, action "reopen-logs" failed in logrotate
Labels:
ubuntu php5-fpm logrotate
Subscribe to:
Post Comments (Atom)
Thanks voor sharing your message.
ReplyDeleteI just received the same error. Many thanks for sharing this, a problem solved.
ReplyDeleteHelpful post. Fixed my Ubuntu 14.04 LTS.
ReplyDeleteThx - same error ... same fix ...
ReplyDeleteThank you very much for the fix!
ReplyDelete