Welcome! Log In Create A New Profile

Advanced

nginx using access.log.1 after using a logrotate script under ubuntu (from source)

pablo platt
March 06, 2010 09:20PM
Hi

I've built nginx from source on ubuntu in /usr/local/nginx according to the
tutorial:
http://articles.slicehost.com/2009/3/4/ubuntu-intrepid-installing-nginx-from-source

and used the init.d script:
http://articles.slicehost.com/2009/3/4/ubuntu-intrepid-adding-an-nginx-init-script

read this about nginx log rotation:
http://www.ruby-forum.com/topic/134115

when forcing logrotate with: sudo logrotate -f /etc/logrotate.conf
nginx starts using access.log.1
but when using a signal manually nginx uses access.log: sudo kill -USR1 `cat
nginx.pid`

If I'm using 'nginx' user in the logrotate script I'm getting an error that
this use doesn't exists so I have to use root.
My logrotate script under /etc/logrotate.d/nginx
/usr/local/nginx/logs/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 nginx adm
sharedscripts
postrotate
[ ! -f /usr/local/nginx/logs/nginx.pid ] || kill -USR1 `cat
/usr/local/nginx/logs/nginx.pid`
endscript
}

What am I doing wrong?
Thanks
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx using access.log.1 after using a logrotate script under ubuntu (from source)

pablo platt March 06, 2010 09:20PM

Re: nginx using access.log.1 after using a logrotate script under ubuntu (from source)

任晓磊 March 06, 2010 09:26PM

Re: nginx using access.log.1 after using a logrotate script under ubuntu (from source)

Boris Dolgov March 06, 2010 11:50PM

Re: nginx using access.log.1 after using a logrotate script under ubuntu (from source)

pablo platt March 07, 2010 03:22AM

Re: nginx using access.log.1 after using a logrotate script under ubuntu (from source)

Daniel Hahler March 08, 2010 08:38AM

Re: nginx using access.log.1 after using a logrotate script under ubuntu (from source)

pablo platt March 09, 2010 08:58AM

Re: nginx using access.log.1 after using a logrotate script under ubuntu (from source)

Daniel Hahler March 08, 2010 08:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready