Re: [HACKERS] more contrib: log rotator

2003-04-05 Thread Jon Jensen
On Fri, 4 Apr 2003, Tom Lane wrote:

 We should also take a look at Apache's rotator to see if there's any need
 to reinvent the wheel at all.  I have not seen it, am not even sure what
 it's written in...

It's written in 140 lines of C (blank lines and all), and has been very
solid in my experience. I don't know of any deficiencies that would
warrant rewriting it.

Jon


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Peter Eisentraut
Andrew Sullivan writes:

 Is anyone interested in having pglog-rotator?

What would get me a whole lot more excited is if the server could write
directly to a file and do its own rotating (or at least reopening of
files).

Considering that your rotator is tailored to a rather specific setup, it
doesn't do anything better compared to established ones, it prevents the
use of pg_ctl, it's written in Perl, and it doesn't do anything for
Windows users, I think it's not suitable for a general audience.

-- 
Peter Eisentraut   [EMAIL PROTECTED]


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread scott.marlowe
On Fri, 4 Apr 2003, Peter Eisentraut wrote:

 Andrew Sullivan writes:
 
  Is anyone interested in having pglog-rotator?
 
 What would get me a whole lot more excited is if the server could write
 directly to a file and do its own rotating (or at least reopening of
 files).
 
 Considering that your rotator is tailored to a rather specific setup, it
 doesn't do anything better compared to established ones, it prevents the
 use of pg_ctl, it's written in Perl, and it doesn't do anything for
 Windows users, I think it's not suitable for a general audience.

That said, a log rotation capability built right into pg_ctl or 
thereabouts would be a very nice feature.  I.e. 'pg_ctl -r 86400 -l 
$PGDATA/logs/pgsql start'

where -r is the rotation period in seconds.  If it's an external program 
that pg_ctl calls that's fine, and it could even just be a carbon copy of 
apache's log rotater if their license is compatible (isn't it?)


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Andrew Sullivan
On Fri, Apr 04, 2003 at 09:16:39AM -0700, scott.marlowe wrote:
 where -r is the rotation period in seconds.  If it's an external program 

Ours rotates based on size rather than time.  I can see some
advantages to the time-based approach, but if you have wide
variations in traffic, you run the risk of rotating over useful files
with more or less empty ones if you use it.

A

-- 

Andrew Sullivan 204-4141 Yonge Street
Liberty RMS   Toronto, Ontario Canada
[EMAIL PROTECTED]  M2P 2A8
 +1 416 646 3304 x110


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Andrew Sullivan
On Fri, Apr 04, 2003 at 05:13:13PM +0200, Peter Eisentraut wrote:
 use of pg_ctl, it's written in Perl, and it doesn't do anything for
 Windows users, I think it's not suitable for a general audience.

It doesn't prevent the use of pg_ctl, although it does indeed prevent
the use of pg_ctl for startup.  

I'm not sufficiently familiar with Windows to know how this does or
does not help them.  Could you elaborate?  And what's wrong with
Perl?

A

-- 

Andrew Sullivan 204-4141 Yonge Street
Liberty RMS   Toronto, Ontario Canada
[EMAIL PROTECTED]  M2P 2A8
 +1 416 646 3304 x110


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Ed L.
On Friday April 4 2003 9:16, scott.marlowe wrote:

 That said, a log rotation capability built right into pg_ctl or
 thereabouts would be a very nice feature.  I.e. 'pg_ctl -r 86400 -l
 $PGDATA/logs/pgsql start'

 where -r is the rotation period in seconds.  If it's an external program
 that pg_ctl calls that's fine, and it could even just be a carbon copy of
 apache's log rotater if their license is compatible (isn't it?)

By way of feature ideas, one very convenient but not widely used feature of 
Apache's log rotator is the ability to specify a strftime() format string 
for the file extension.  For example, if I want to have my logs rollover 
every 24 hours and be named log.Mon, log.Tue, log.Wed, I say something like

pg_ctl start | rotatelogs 86400 %a

This causes the logs to overwrite themselves every seven days, taking log 
maintenance time to very near zero.  We also customized our use of it to 
allow us to automatically move existing logs out of the way to log.1, 
log.2, or to simply overwrite existing logs.

Ed


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Ed L.
On Friday April 4 2003 10:04, Ed L. wrote:
 By way of feature ideas, one very convenient but not widely used feature
 of Apache's log rotator is the ability to specify a strftime() format
 string for the file extension.  For example, if I want to have my logs
 rollover every 24 hours and be named log.Mon, log.Tue, log.Wed, I say
 something like

   pg_ctl start | rotatelogs 86400 %a

More accurately, something like this:

pg_ctl start | rotatelogs 86400 log.%a

Ed


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Jan Wieck
Peter Eisentraut wrote:
 
 Andrew Sullivan writes:
 
  Is anyone interested in having pglog-rotator?
 
 What would get me a whole lot more excited is if the server could write
 directly to a file and do its own rotating (or at least reopening of
 files).

From a technical point of view I don't think that is desirable. The
entire log traffic would have to be routed through the postmaster, as it
is in LibertyRMS's log rotator now through the perl script. And we
really try to keep everything outside the postmaster that does not
absolutely have to be in there for stability reasons.

We can discuss if the log rotator should be a child process of the
postmaster or the other way round, but that will not change the flow of
bytes between the processes in any way.

I would say it's better the way it is, because it does not pollute the
postmasters wait logic with another exception.

My ideal solution would be to integrate the log rotators functionality
into a C version of pg_ctl that forks and detaches from the control
terminal in the way, daemons should.


Jan

-- 
#==#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.  #
#== [EMAIL PROTECTED] #


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread scott.marlowe
On Fri, 4 Apr 2003, Andrew Sullivan wrote:

 On Fri, Apr 04, 2003 at 09:16:39AM -0700, scott.marlowe wrote:
  where -r is the rotation period in seconds.  If it's an external program 
 
 Ours rotates based on size rather than time.  I can see some
 advantages to the time-based approach, but if you have wide
 variations in traffic, you run the risk of rotating over useful files
 with more or less empty ones if you use it.

I would want time based for sure, and I can see the use for size based 
splitting as well.  I wouldn't be hard to have it do both would it?

I just like the idea of it being one of the dozens or so options for 
pg_ctl so it's painless to use for joe six pack.

pg_ctl -r 86400 -l $PGDATA/logs/pgsql

where -r is the rotation period

OR

pg_ctl -f 10M -l $PGDATA/logs/pgsql

where -f is the max file size of a log

I'd recommend that the nameing convnention should probably 
be:

filenamespec.timestamp, like:  $PGDATA/logs/pgsql.1049414400

for time rotated logs, and 

filename.incnumber like:  $PGDATa/logs/pgsql.01


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Ed L.
On Friday April 4 2003 10:19, Tom Lane wrote:

 I feel we really ought to have *some* rotator included in the standard
 distro, just so that the Admin Guide can point to a concrete solution
 instead of having to arm-wave about what you can get off the net.
 If someone can offer a better alternative than Andrew's, great, let's
 see it.

Out of curiosity, are there issues preventing inclusion of Apache's log 
rotation code?  It seems you'd be hard-pressed to find a more 
battle-hardened log rotator.

Obviously some people also wish to rotate based on log file size, so adding 
both to contrib at least seems sensible.

Ed


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread scott.marlowe
On Fri, 4 Apr 2003, Ed L. wrote:

 On Friday April 4 2003 10:19, Tom Lane wrote:
 
  I feel we really ought to have *some* rotator included in the standard
  distro, just so that the Admin Guide can point to a concrete solution
  instead of having to arm-wave about what you can get off the net.
  If someone can offer a better alternative than Andrew's, great, let's
  see it.
 
 Out of curiosity, are there issues preventing inclusion of Apache's log 
 rotation code?  It seems you'd be hard-pressed to find a more 
 battle-hardened log rotator.
 
 Obviously some people also wish to rotate based on log file size, so adding 
 both to contrib at least seems sensible.

OK, I'm playing with the pg_ctl script that comes with 7.3, and trying to 
make it startup with apaches rotatelog script, but this line won't pipe 
output.  I'm a total noob at bash shell scripting, so please feel free to 
snicker when you answer.

rotatelogs is in my path and all, it just never sees it.

$po_path ${1+$@} /dev/null | $PGPATH/rotatelogs $logfile $DURATION 21 


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Tom Lane
scott.marlowe [EMAIL PROTECTED] writes:
 rotatelogs is in my path and all, it just never sees it.

You mean the command fails?  Or just that it doesn't capture output?

 $po_path ${1+$@} /dev/null | $PGPATH/rotatelogs $logfile $DURATION 21 

Most if not all of the postmaster's log output goes to stderr, so you'd need

$po_path ${1+$@} /dev/null 21 | $PGPATH/rotatelogs ...

to have any hope of useful results.

regards, tom lane


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Ed L.
On Friday April 4 2003 11:58, Tom Lane wrote:
 scott.marlowe [EMAIL PROTECTED] writes:
  rotatelogs is in my path and all, it just never sees it.

 You mean the command fails?  Or just that it doesn't capture output?

  $po_path ${1+$} /dev/null | $PGPATH/rotatelogs $logfile $DURATION
  21 

 Most if not all of the postmaster's log output goes to stderr, so you'd
 need

 $po_path ${1+$} /dev/null 21 | $PGPATH/rotatelogs ...

 to have any hope of useful results.

Hmmm.  I would have agreed 21 was needed, too, but this command seems to 
routinely capture all output, including ERRORs:

nohup pg_ctl start | nohup rotatelogs server_log.%a 86400

Ed


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread scott.marlowe
On Fri, 4 Apr 2003, Tom Lane wrote:

 scott.marlowe [EMAIL PROTECTED] writes:
  rotatelogs is in my path and all, it just never sees it.
 
 You mean the command fails?  Or just that it doesn't capture output?

The database starts, but rotatelogs doesn't get run.  I.e. it's just like 
everything after the | symbol isn't there.


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Tom Lane
Ed L. [EMAIL PROTECTED] writes:
 Hmmm.  I would have agreed 21 was needed, too, but this command seems to 
 routinely capture all output, including ERRORs:
   nohup pg_ctl start | nohup rotatelogs server_log.%a 86400

That's 'cause pg_ctl internally redirects the postmaster's stderr.

regards, tom lane


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread scott.marlowe
On Fri, 4 Apr 2003, Ed L. wrote:

 On Friday April 4 2003 11:58, Tom Lane wrote:
  scott.marlowe [EMAIL PROTECTED] writes:
   rotatelogs is in my path and all, it just never sees it.
 
  You mean the command fails?  Or just that it doesn't capture output?
 
   $po_path ${1+$@} /dev/null | $PGPATH/rotatelogs $logfile $DURATION
   21 
 
  Most if not all of the postmaster's log output goes to stderr, so you'd
  need
 
  $po_path ${1+$@} /dev/null 21 | $PGPATH/rotatelogs ...
 
  to have any hope of useful results.
 
 Hmmm.  I would have agreed 21 was needed, too, but this command seems to 
 routinely capture all output, including ERRORs:
 
   nohup pg_ctl start | nohup rotatelogs server_log.%a 86400

OK, So I tried putting the 21 before the | and all.  No matter what I 
try, every from the | on is ignored.  ps doesn't show it, and neither does 
pg_ctl status.  Both show a command line of 
/usr/local/pgsql/bin/postmaster as the only input to start the server.

Now, the thing is, I've tried this with hardcoded values, like:

$po_path ${1+$@} /dev/null 21 /usr/local/pgsql/bin/rotatelogs 
/mnt/d1/data/logs/pglog 86400

where I know the logs directory exists.  It works if I do:

pg_ctl start | rotatelogs $PGDATA/pglog 86400 21

and puts the log files there.

I've copied rotatelogs into the /usr/local/pgsql/bin directory as well.

So, I'm thinking this is my weakness in shell scripting that's getting me 
here, and that the shell is eating the |, not passing it out with the 
postmaster to be used when it starts.


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Ed L.
On Friday April 4 2003 2:17, scott.marlowe wrote:

 OK, So I tried putting the 21 before the | and all.  No matter what I
 try, every from the | on is ignored.  ps doesn't show it, and neither
 does pg_ctl status.  Both show a command line of
 /usr/local/pgsql/bin/postmaster as the only input to start the server.

Not clear if you're looking at it this way or if this is your problem, but 
you can't really tell there is log rotation going on just by grepping ps 
for postmaster because ps does not typically show the postmaster and the 
rotatelogs together on the same line.  I wouldn't expect pg_ctl status to 
know anything at all about rotatelogs when you pipe it like this.

Ed


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread scott.marlowe
On Fri, 4 Apr 2003, Ed L. wrote:

 On Friday April 4 2003 2:17, scott.marlowe wrote:
 
  OK, So I tried putting the 21 before the | and all.  No matter what I
  try, every from the | on is ignored.  ps doesn't show it, and neither
  does pg_ctl status.  Both show a command line of
  /usr/local/pgsql/bin/postmaster as the only input to start the server.
 
 Not clear if you're looking at it this way or if this is your problem, but 
 you can't really tell there is log rotation going on just by grepping ps 
 for postmaster because ps does not typically show the postmaster and the 
 rotatelogs together on the same line.  I wouldn't expect pg_ctl status to 
 know anything at all about rotatelogs when you pipe it like this.

Hey, do you guys think that a setting of silent_mode = false might affect 
no log files getting created?

I had it right as soon as I added Tom's recommended 21 but spent another 
30 minutes figuring out why my log file wasn't getting created / filled.   

Thanks for the help.


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Tom Lane
scott.marlowe [EMAIL PROTECTED] writes:
 Hey, do you guys think that a setting of silent_mode = false might affect 
 no log files getting created?

No, but setting it to true would be bad news.

regards, tom lane


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread scott.marlowe
On Fri, 4 Apr 2003, Tom Lane wrote:

 scott.marlowe [EMAIL PROTECTED] writes:
  Hey, do you guys think that a setting of silent_mode = false might affect 
  no log files getting created?
 
 No, but setting it to true would be bad news.

That's what I'd meant actually.  I had to turn of silent mode...  You know 
you're having a bad day when your email explaining how stupid you are is 
factually incorrect. :-)

 If anyone wants the diff, here it is:

22c22
   $CMDNAME start   [-w] [-D DATADIR] [-s] [-l FILENAME] [-o \OPTIONS\]
---
   $CMDNAME start   [-w] [-D DATADIR] [-s] [-r DURATION] [-l FILENAME] 
[-o \OPTIONS\]
39a40,41
   -r DURATION invoke log rotation with DURATION seconds
   between rotation of files.
155a158,161
   -r)
   DURATION=$2
   shift
   ;;
336c342,346
 $po_path ${1+$@} /dev/null $logfile 21 
---
 if [ -n $DURATION ]; then
 $po_path ${1+$@} /dev/null 21| $PGPATH/rotatelogs 
$logfile $DURATION 21 
 else
 $po_path ${1+$@} /dev/null $logfile 21 
 fi


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Peter Eisentraut
Tom Lane writes:

 AFAICS, the only practical way to do this is to have a single process
 collecting the stdout/stderr from the postmaster and all its children.

I think not.  It's a little tricky handling it directly in the child
processes, but it's been done before.

 If someone can offer a better alternative than Andrew's, great, let's
 see it.

How about the attached one, which I floated a while ago but which didn't
generate much interest.

-- 
Peter Eisentraut   [EMAIL PROTECTED]
#include c.h

#include sys/types.h
#include sys/stat.h
#include fcntl.h
#include signal.h
#include errno.h
#include unistd.h

#include pqsignal.h

volatile static int hangup_flag = 0;


static void
signalhandler(SIGNAL_ARGS)
{
hangup_flag = 1;
}


#define BUF_SIZE 8192
#define MAX_ERRORS 200

#define MAX_ERRORS_CHECK() do { errcount++; if (max_errors  0  errcount = 
max_errors) exit(2); } while(0)

int
main(int argc, char *argv[])
{
const char *filename;
int fd = -1;
static char buf[BUF_SIZE];
unsigned int errcount = 0;
unsigned int max_errors = MAX_ERRORS;

if (argc != 2)
{
fprintf(stderr, %s: missing required argument\n, argv[0]);
fprintf(stderr, Try '%s --help' for more information.\n, argv[0]);
exit(1);
}

if (strcmp(argv[1], --help)==0)
{
printf(this should be a help message...\n);
exit(0);
}

filename = argv[1];

fd = open(filename, O_WRONLY | O_CREAT | O_NOCTTY | O_APPEND, 0666);
if (fd  0)
{
fprintf(stderr, %s: could not open file %s: %s\n,
argv[0], filename, strerror(errno));
exit(1);
}

pqsignal(SIGUSR1, signalhandler);

for (;;)
{
int read_bytes;
int written_bytes;
char * buf_ptr;

read_bytes = read(0, buf, sizeof(buf));
if (read_bytes  0)
{
if (errno == EINTR)
continue;
else
{
fprintf(stderr, *** %s: read error from %s: %s\n,
argv[0], filename, strerror(errno));
MAX_ERRORS_CHECK();
}
}
if (read_bytes == 0)
{
/* end of file, postmaster exited? */
close(fd);
exit(0);
}

if (hangup_flag)
{
int fdnew;

fdnew = open(filename, O_WRONLY | O_CREAT | O_NOCTTY | 
O_APPEND, 0666);
if (fdnew  0)
{
fprintf(stderr, *** %s: could not open new output 
file %s: %s\n,
   argv[0], filename, strerror(errno));
MAX_ERRORS_CHECK();
}
else
{
close(fd);
fd = fdnew;
}
hangup_flag = 0;
}

buf_ptr = buf;
do
{
written_bytes = write(fd, buf_ptr, read_bytes);
if (written_bytes  0)
{
if (errno == EINTR)
continue;
fprintf(stderr, *** %s: could not write to file %s: 
%s\n,
argv[0], filename, strerror(errno));
MAX_ERRORS_CHECK();

break;
}
if (written_bytes  read_bytes)
{
buf_ptr += written_bytes;
read_bytes -= written_bytes;
continue;
}
break;
} while(1);
}

return 127;
}

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] more contrib: log rotator

2003-04-04 Thread Tom Lane
Peter Eisentraut [EMAIL PROTECTED] writes:
 Tom Lane writes:
 AFAICS, the only practical way to do this is to have a single process
 collecting the stdout/stderr from the postmaster and all its children.

 I think not.  It's a little tricky handling it directly in the child
 processes, but it's been done before.

A little tricky?  Thanks, but no thanks ... for one thing, there'd be
no easy way to know when all the children had switched over to writing
the new file.  Also, at least for not-too-long messages, writing on a
single pipe gives atomicity guarantees that AFAIK do not exist when
writing a file through multiple independently opened descriptors.  In
the latter case I think we'd have lots of trouble with interleaving of
messages from different backends.

 If someone can offer a better alternative than Andrew's, great, let's
 see it.

 How about the attached one, which I floated a while ago but which didn't
 generate much interest.

Seems like a good bare-bones file writer; but how about all those
frammishes that people ask for like generating date-based filenames,
switching every so many bytes, etc?  Also, it'd be nice not to be
dependent on a cron job to tickle the switchover.

I do think there's an efficiency argument for having the log writer
coded in C, so starting with what you have here and building up might
be a better idea than starting with Andrew's perl script.  But the
important thing in my mind is to get something in there.

We should also take a look at Apache's rotator to see if there's any need
to reinvent the wheel at all.  I have not seen it, am not even sure what
it's written in...

regards, tom lane


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[HACKERS] more contrib: log rotator

2003-04-03 Thread Andrew Sullivan
Since now is the time for contrib/ flamewars, this seemed a good time
to suggest this.

My colleague, Sorin Iszlai, wrote us a little program for rotating
our Postgres logs.  It reads stdout and stderr, and sends them to
different files (and rotates them as necessary).  It is currently
hand-configureable (i.e. by altering some variables at the top of the
script), and is more or less designed for use in our own environment.

Tom Lane recently mentioned to me that a common complaint is that
postgres doesn't have its own log rotator.  There are, of course,
plenty of good ones, and syslog itself works pretty well for most
people.  But there are still complaints from time to time about the
lack of a built in log rotator.

We'd be happy to release our rotator under the PostgreSQL BSD
license, if it would be of use to people.  I was thinking that
perhaps contrib/ would be a good place for it, since the idea is to
reduce complaints that there's no log rotator included.  

Is anyone interested in having pglog-rotator?

A
-- 

Andrew Sullivan 204-4141 Yonge Street
Liberty RMS   Toronto, Ontario Canada
[EMAIL PROTECTED]  M2P 2A8
 +1 416 646 3304 x110


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] more contrib: log rotator

2003-04-03 Thread Tom Lane
Andrew Sullivan [EMAIL PROTECTED] writes:
 Is anyone interested in having pglog-rotator?

FWIW, I saw an early version of pglog-rotator about a year and a half
ago (while consulting for LibertyRMS), and thought at the time that
it was pretty cool.  So I'm for including it ... maybe even as
mainstream instead of contrib.

regards, tom lane


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly


Re: [HACKERS] more contrib: log rotator

2003-04-03 Thread Jim Buttafuoco
Would the plan be to add it to pg_ctl?


 Andrew Sullivan [EMAIL PROTECTED] writes:
  Is anyone interested in having pglog-rotator?
 
 FWIW, I saw an early version of pglog-rotator about a year and a half
 ago (while consulting for LibertyRMS), and thought at the time that
 it was pretty cool.  So I'm for including it ... maybe even as
 mainstream instead of contrib.
 
   regards, tom lane
 
 ---(end of broadcast)---
 TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] more contrib: log rotator

2003-04-03 Thread Tom Lane
Jim Buttafuoco [EMAIL PROTECTED] writes:
 Would the plan be to add it to pg_ctl?

You would not actually have to: you could just pipe pg_ctl's output to
pglog-rotator.  But I think it'd be cool if pg_ctl had an option to use
pglog-rotator, or maybe even adopt it as standard behavior.

I think we would have to make the rotator script be mainstream rather
than contrib if we wanted pg_ctl to use it directly.  That was why I was
thinking maybe mainstream ...

Andrew, could you toss up the script on pgsql-patches just so people can
take a look?  Then we could think more about where to go with it.

regards, tom lane


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] more contrib: log rotator

2003-04-03 Thread Dave Cramer
Does this log rotator do something that apache's doesn't?

Dave
On Thu, 2003-04-03 at 13:41, Tom Lane wrote:
 Jim Buttafuoco [EMAIL PROTECTED] writes:
  Would the plan be to add it to pg_ctl?
 
 You would not actually have to: you could just pipe pg_ctl's output to
 pglog-rotator.  But I think it'd be cool if pg_ctl had an option to use
 pglog-rotator, or maybe even adopt it as standard behavior.
 
 I think we would have to make the rotator script be mainstream rather
 than contrib if we wanted pg_ctl to use it directly.  That was why I was
 thinking maybe mainstream ...
 
 Andrew, could you toss up the script on pgsql-patches just so people can
 take a look?  Then we could think more about where to go with it.
 
   regards, tom lane
 
 
 ---(end of broadcast)---
 TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
-- 
Dave Cramer [EMAIL PROTECTED]
Cramer Consulting


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] more contrib: log rotator

2003-04-03 Thread Andrew Sullivan
On Thu, Apr 03, 2003 at 01:41:08PM -0500, Tom Lane wrote:
 You would not actually have to: you could just pipe pg_ctl's output to
 pglog-rotator.  But I think it'd be cool if pg_ctl had an option to use
 pglog-rotator, or maybe even adopt it as standard behavior.

It's currently built to call a program, and read its stdout and
stderr, rather than acting as a pipe.  I guess it shouldn't be too
hard to modify, though.  We actually call the postmaster directly
with it, so we use it as a replacement for pg_ctl at startup.

 Andrew, could you toss up the script on pgsql-patches just so people can
 take a look?  Then we could think more about where to go with it.

Ok, I sent it.

A

-- 

Andrew Sullivan 204-4141 Yonge Street
Liberty RMS   Toronto, Ontario Canada
[EMAIL PROTECTED]  M2P 2A8
 +1 416 646 3304 x110


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] more contrib: log rotator

2003-04-03 Thread Andrew Sullivan
On Thu, Apr 03, 2003 at 02:12:03PM -0500, Dave Cramer wrote:
 Does this log rotator do something that apache's doesn't?

Probably not.  This was just easier for us.

A little information might be handy here: we run postgres nder a
hosted environment, and we do not have root on the relevant boxes. 
So installing anything even a little complicated means building
everything ourselves.  As a result, we end up re-creating plenty of
functionality just to make it easy to install.

A

-- 

Andrew Sullivan 204-4141 Yonge Street
Liberty RMS   Toronto, Ontario Canada
[EMAIL PROTECTED]  M2P 2A8
 +1 416 646 3304 x110


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Re: [HACKERS] more contrib: log rotator

2003-04-03 Thread Andrew Sullivan
On Thu, Apr 03, 2003 at 01:41:08PM -0500, Tom Lane wrote:
 Andrew, could you toss up the script on pgsql-patches just so people can
 take a look?  Then we could think more about where to go with it.

Ok, the first try failed (of course) because I wasn't subscribed. 
Should be there now, though.

A

-- 

Andrew Sullivan 204-4141 Yonge Street
Liberty RMS   Toronto, Ontario Canada
[EMAIL PROTECTED]  M2P 2A8
 +1 416 646 3304 x110


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html