Re: Reopen logfile on SIGHUP

Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>

From: Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
To: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, Greg Stark <stark@mit.edu>, Anastasia Lubennikova <a.lubennikova@postgrespro.ru>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-10T20:31:47Z
Lists: pgsql-hackers

Attachments

El 10/04/18 a las 22:40, Robert Haas escribió:
>
>> Having said that, I'm not averse to providing a solution if it's robust,
>> not too invasive and doesn't break other use-cases.  So far we've not
>> seen a patch that meets those conditions.
> Fair enough.
>

Syslogger does already rotate logs properly on SIGHUP under some 
conditions, so we can just change this to unconditional rotation. 
Probably some people wouldn't want their logs to be rotated on SIGHUP, 
so we could also add a GUC to control this. Please see the attached patch.

-- 
Alexander Kuzmenkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Implement "pg_ctl logrotate" command