Tim Goodaire tgoodair
Mon Aug 15 15:27:36 PDT 2005
On Fri, Aug 12, 2005 at 04:11:11PM -0400, Sven Willenberger wrote:
> FreeBSD 5.4
> slony1-1.1.0
> postgresql 8.0.3
> 
> I have been banging my head over slony log rotation for quite some time
> now and I am at a loss. Here is the situation:
> 
> I have 2 ways I can start slony:
> 
> 1) su slony -c "/usr/local/bin/slon -p /var/run/slon/slon.pid -d 2 T1
> dbname=thedb > /usr/local/etc/slony/slony.out 2>&1 &"
> 
> or
> 
> 2) su slony -c "/usr/local/bin/slon -f /usr/local/etc/slon.conf
> > /dev/null 2>&1 &"
> 
> Both of these methods will start up slon, background it so as not to
> spew messages to console and get tied to tty, and log it (either to the
> slony.out file in case #1, or /var/log/slony.log via syslog in case #2).
> 
> Here is the problem:
> 
> With method 1, if I use newsyslog to rotate slony.out (or manually
> rotate it), issuing a kill -HUP to to /var/run/slon/slon.pid restarts
> the process but it will not log to the new file, it actually logs to
> slony.out.0 -- i.e. it appears to latch onto the inode number of the
> logfile and will not renew it during a sighup. The result is no clean
> way of rotating the logfile other than stopping slon, rotating the
> logfile, and then starting slon.

You could look into using apache rotatelogs to rotate your slony logs. 
It works very well, and is directly supported by the altperl scripts.

-- 
Tim Goodaire    416-673-4126    tgoodair at ca.afilias.info
Database Administrator, Afilias Canada Corp.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050815/e1630ae1/attachment.bin


More information about the Slony1-general mailing list