Обсуждение: postmaster will not start with stale lockfile but not report why

Поиск
Список
Период
Сортировка

postmaster will not start with stale lockfile but not report why

От
Rudolf Potucek
Дата:
Hi!

I just spent half an hour looking for the reason postgres/postmaster (on
Linux Mandrake 8.2) would not start. The only thing in the log (even at
debug level 4m assuming pg_ctl -o option works) was:

Oct  4 14:05:43 antimony3 su(pam_unix)[3444]: session opened for user
postgres b
y (uid=0)
Oct  4 14:05:44 antimony3 su(pam_unix)[3444]: session closed for user
postgres
Oct  4 14:05:45 antimony3 postgresql: Starting postgresql service:
failed

Maybe, just maybe, it would be nice if the server croaked a bit more
vebously?

Rudolf

Re: postmaster will not start with stale lockfile but not report why

От
Tom Lane
Дата:
Rudolf Potucek <potucek@ucalgary.ca> writes:
> Oct  4 14:05:45 antimony3 postgresql: Starting postgresql service:
> failed

> Maybe, just maybe, it would be nice if the server croaked a bit more
> vebously?

The postmaster croaks as verbosely as it can.  I'll bet lunch that your
system's startup script is redirecting the postmaster's stderr to
/dev/null (or using the -S switch which has the same effect).  If so,
we are not the people to complain to ...

            regards, tom lane

Re: postmaster will not start with stale lockfile but not report why

От
Lee Kindness
Дата:
A pet annoyance with the Linux RPMs... They are shipped with syslog
enabled and postmaster sdtout/stderr redirected to /dev/null. So
unless the user specifically sets up the needed info in
/etc/syslog.conf then they never hear a squeak from PostgreSQL!

I'm by no means an RPM expert, but judging by the installation of
other packages this hopefully can be handled automatically. A suitable
/etc/logrotate.d/postgresql file could be in the RPM and In the
post-install script the following rough steps would take place:

 1. Check if /var/log/postgresql is in /etc/syslog.conf, if not add
it:

  local0.*    /var/log/postgresql

 2. Restart syslogd:

  /etc/init.d/syslog restart

Obviously there is the added issue of cross distribution file
locations (I'm coming from a Redhat perspective here) - what does the
LSB/FSH say about syslog.conf and logrotate files? Guess i need to
check...

Lamar, would this be easy to do for the RPMs? If you could point me in
the right direction I could take a look...

Thanks, Lee Kindness.

Tom Lane writes:
 > Rudolf Potucek <potucek@ucalgary.ca> writes:
 > > Oct  4 14:05:45 antimony3 postgresql: Starting postgresql service:
 > > failed
 >
 > > Maybe, just maybe, it would be nice if the server croaked a bit more
 > > vebously?
 >
 > The postmaster croaks as verbosely as it can.  I'll bet lunch that your
 > system's startup script is redirecting the postmaster's stderr to
 > /dev/null (or using the -S switch which has the same effect).  If so,
 > we are not the people to complain to ...
 >
 >             regards, tom lane
 >
 > ---------------------------(end of broadcast)---------------------------
 > TIP 5: Have you checked our extensive FAQ?
 >
 > http://www.postgresql.org/users-lounge/docs/faq.html