In my /etc/logrotate.d/nginx I saw,/var/log/nginx/*.log {        daily        missingok        rotate 52        compress        delaycompress        notifempty        create 640 nginx adm        sharedscripts        postrotate                [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`        endscript}The postrotate script looks like killing the nginx process, which does not make sense so I must be wrong.What it is doing?
What does this logrotate nginx config do?
kill;daemon;signals;nginx;logrotate
Nginx responds to the USR1 signal by reopening its log files.The USR1 signal kills a program by default, but it's meant to be handled to do whatever the program finds useful. Each program defines what it does with USR1 and USR2; for Nginx, that's reopening the log files (for log rotation) and executing a new instance (for upgrades).By convention, most daemons respond to the HUP signal by reloading their configuration file. Nginx follows this convention. The original intent of the HUP signal was to signal the end of a session to interactive process (modem hang up the user's gone, there's no point in continuing), but that meaning doesn't apply to daemons.