Обсуждение: logs
I have a linux instalation (from rpm) of postgres-7.0.3, which puts the logs of the server (AFAIK) in /var/log/postgresql. But the file is empty, and I start making activity on the database and it stays empty. Does anyone have an idea of what is happening? Also, on a Solaris 8 machine, compiled from sources (uuhhh I like it) postgres-7.1beta, I get the output of the server messages in the file /home/postgres/1. This server is started with the pg_ctrl script. Any ideas are welcomed. ;-) -- System Administration: It's a dirty job, but someone told I had to do it. ----------------------------------------------------------------- Martín Marqués email: martin@math.unl.edu.ar Santa Fe - Argentina http://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar -----------------------------------------------------------------
On Tue, 19 Dec 2000, Martin A. Marques wrote: > I have a linux instalation (from rpm) of postgres-7.0.3, which puts the logs > of the server (AFAIK) in /var/log/postgresql. > But the file is empty, and I start making activity on the database and it > stays empty. Does anyone have an idea of what is happening? Two possiblities. 1) is the file writeable by the postgres user and 2) do you have logrotate running. Postmaster keeps a tight tie to the log file it is started with so even if the file is changed/moved by logrotate the logging continues to the original file. I've resorted to using a postrotate /etc/rc.d/init.d/postgres restart endscript in my logrotate scripts. Mostly because the server(s) are not under any kind of load at night and I haven't taken the time to figure out the 'correct' way to re-initialze the postmaster process. Rod
El Mié 20 Dic 2000 09:11, Roderick A. Anderson escribió: > > Two possiblities. 1) is the file writeable by the postgres user and 2) do > you have logrotate running. Postmaster keeps a tight tie to the log file > it is started with so even if the file is changed/moved by logrotate the > logging continues to the original file. I've resorted to using a Answer to 1): The file is owned by postgres drwxr-xr-x 4 root root 2048 Dec 17 04:02 ./ drwxr-xr-x 19 root root 1024 Apr 17 2000 ../ -rw------- 1 root root 30744 Dec 20 12:10 cron -rw------- 1 root root 60456 Dec 17 04:02 cron.1 -rw------- 1 root root 64365 Dec 10 04:02 cron.2 -rw------- 1 root root 62189 Dec 3 04:02 cron.3 -rw------- 1 root root 62529 Nov 26 04:02 cron.4 -rw-r--r-- 1 root root 2226 Dec 13 20:39 dmesg -rwx------ 1 postgres postgres 0 Dec 17 04:02 postgresql* -rwx------ 1 postgres postgres 33 Dec 10 04:02 postgresql.1.gz* -rwx------ 1 postgres postgres 33 Dec 3 04:02 postgresql.2.gz* Now, why is the postgresql log exacutable, and why does the rotate gzip it, while others are not? > postrotate > /etc/rc.d/init.d/postgres restart > endscript Answer to 2) is that all I have is syslogd and klogd running. Logrotate is running on the cron. -- System Administration: It's a dirty job, but someone told I had to do it. ----------------------------------------------------------------- Martín Marqués email: martin@math.unl.edu.ar Santa Fe - Argentina http://math.unl.edu.ar/~martin/ Administrador de sistemas en math.unl.edu.ar -----------------------------------------------------------------