Sven Willenberger sven
Fri Aug 12 21:10:00 PDT 2005
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.

With method 2, I seem to have a case whereby slon is not aware of its
listeners or something similar and keeps "restarting":
Aug 12 11:52:09 server slon[89926]: [29-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 11:52:09 server slon[89926]: [30-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:02:30 server slon[89926]: [31-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:02:30 server slon[89926]: [32-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:14:26 server slon[89926]: [33-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:14:26 server slon[89926]: [34-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:25:16 server slon[89926]: [35-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:25:16 server slon[89926]: [36-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:35:39 server slon[89926]: [37-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:35:39 server slon[89926]: [38-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:46:32 server slon[89926]: [39-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:46:32 server slon[89926]: [40-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:58:28 server slon[89926]: [41-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 12:58:28 server slon[89926]: [42-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 13:09:56 server slon[89926]: [43-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 13:09:56 server slon[89926]: [44-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 13:20:31 server slon[89926]: [45-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 13:20:31 server slon[89926]: [46-16] CONFIG main: slon version
1.1.0 starting up
Aug 12 13:31:39 server slon[89926]: [47-16] CONFIG main: slon version
1.1.0 starting up

Also, with method 2, at each restart interval the number of entries of
"cleanupThread" increases by one; i.e. after the first restart, 2
cleanupThread entries, the next restart had 4, the next had 6, the next
restart had 8 and so on. It's as if when using syslog, for some reason
the worker threads are not being recognized?? Trying to run this through
daemontools did not help and I end up seeing the same behavior as with
the syslog method. The variable here seems to be using the config file
or not. Either way, at the moment I have no automagic way of rotating
logfiles that does not end up in some anomalies. Any ideas here?

Sven



More information about the Slony1-general mailing list