logrotate action "rotate" failed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Nginx |
Triaged
|
Undecided
|
Thomas Ward | ||
Stable |
Triaged
|
High
|
Thomas Ward |
Bug Description
Last night logrotate ran and came back with a error running the postrotate scripts:
error: error running shared postrotate script for '/var/log/
run-parts: /etc/cron.
The current postrotate script contains:
invoke-rc.d nginx rotate >/dev/null 2>&1
I ran this manually and got this error:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service nginx rotate
The script you are attempting to invoke has been converted to an Upstart
job, but rotate is not supported for Upstart jobs.
It looks like rotate is no longer a command I can pass to nginx.
I have looked into possible alternatives but haven't tested them on my server:
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
Or using the following command from upstart:
reload JOB [KEY=VALUE]
I am running:
Ubuntu precise (12.04.5)
nginx-common 1.8.0-1+precise1
Changed in nginx: | |
status: | New → Triaged |
tags: | added: ppa |
no longer affects: | nginx (Ubuntu) |
Changed in nginx: | |
status: | Triaged → In Progress |
Changed in nginx: | |
status: | In Progress → Triaged |
I have the same issue, but I have also observed that after logrotate fails, new access.log, access.log.1 and access.log.*.gz files are created. However, nginx will continue to write to the old acces.log file (i.e. access.log.1) until a configuration reload (service nginx reload, service nginx restart, system reboot, etc.).
This happens with both error and access log files.