해당 분류 : 서버에 대한 이야기    FIXED: Ubuntu Server cron error message: invoke-rc.d: initscript php5-fpm, action "reopen-logs" failed in logrotate    글을 기록한 날 : 2014/10/16 11:25

FIXED: Ubuntu Server cron error message: invoke-rc.d: initscript php5-fpm, action "reopen-logs" failed in logrotate

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

Creative Commons License
Creative Commons License
◀ PREV 1 ... 3 4 5 6 7 8 9 10 11 ... 29 NEXT ▶

Notice

Blogroll

Counter

· Total
: 274246
· Today
: 20
· Yesterday
: 36