Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jun 2003 21:45:29 +0200
From:      Clement Laforet <sheepkiller@cultdeadsheep.org>
To:        "Emilio Manuel" <curioso1100@hotmail.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: problem Postgres rotation logs
Message-ID:  <20030614214529.3dd34a55.sheepkiller@cultdeadsheep.org>
In-Reply-To: <Law15-F44wQ1AoMEDYm00039ec8@hotmail.com>
References:  <Law15-F44wQ1AoMEDYm00039ec8@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 14 Jun 2003 18:21:29 +0000
"Emilio Manuel" <curioso1100@hotmail.com> wrote:

> I use Postgres as database for my web site. Postgres write logs to=20
> /var/log/pgsql.log.
>=20
> To make log rotation, I append:
>=20
> /var/log/pgsql          pgsql:pgsql     600  4     *    $W0D23  Z
>=20
> to /etc/newsyslog
>=20
> The rotation works fine and Postgres still work after it occurs, but unti=
l I=20
> stop and start again Postgres, it doesn_t write any line to the new file=
=20
> /var/log/pgsql.log
>=20
> =BFWhat am I doing wrong?


you need to send a kill -HUP to Postgres process, because you change the fi=
le name but not he file descriptor.

according to man newsyslog :
     path_to_pid_file
             This optional field specifies the file name to read to find the
             daemon process id, or to find a process group id if the U flag
             was specified.  If this field is present, a signal_number is s=
ent
             the process id contained in this file.  If this field is not
             present, then a SIGHUP signal will be sent to syslogd(8), unle=
ss
             the N flag has been specified.  This field must start with "/"=
 in
             order to be recognized properly.


Regards,

clem



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030614214529.3dd34a55.sheepkiller>