Обсуждение: Postgresql didn't start after power failure

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

Postgresql didn't start after power failure

От
Clodoaldo Pinto
Дата:
There was a power failure and then the postgresql service didn't start on
system restart:

System restart after power failure:
Jan 12 16:49:06 s1 syslogd 1.4.1: restart.
Jan 12 16:49:18 s1 su(pam_unix)[2098]: session opened for user postgres by
(uid=0)
Jan 12 16:49:18 s1 su(pam_unix)[2098]: session closed for user postgres
Jan 12 16:49:19 s1 postgresql: Iniciando serviço postgresql :  failed

When I manually rebooted the system postgres restarted:
Jan 12 18:40:42 s1 su(pam_unix)[2083]: session opened for user postgres by
(uid=0)
Jan 12 18:40:43 s1 su(pam_unix)[2083]: session closed for user postgres
Jan 12 18:40:44 s1 postgresql: Iniciando serviço postgresql :  succeeded

/var/log/pgsql is empty and is chmoded as executable (?). It is an Anaconda
install in FC2. Now up to 7.4.6.

The last activity before power failure was a vacuum full and after that nothing
at all for more than one hour.
Is there anyway to know why did it not start and prevent it to happen again?
How to configure it to write a log at system boot?

Regards, Clodoaldo Pinto





_______________________________________________________
Yahoo! Acesso Grátis - Instale o discador do Yahoo! agora. http://br.acesso.yahoo.com/ - Internet rápida e grátis

Re: Postgresql didn't start after power failure

От
"Ed L."
Дата:
On Wednesday January 12 2005 1:08, Clodoaldo Pinto wrote:
> There was a power failure and then the postgresql service didn't start on
> system restart:
>
> The last activity before power failure was a vacuum full and after that
> nothing at all for more than one hour.
> Is there anyway to know why did it not start and prevent it to happen
> again? How to configure it to write a log at system boot?

PostgreSQL has a safety check that prevents it from restarting if it thinks
there may be residual shared memory segments that might cause a problem.
Your server log will tell you how to check (see ipcs).

It is rare in my experience that failed restarts due to the safety check are
valid.  You can usually just nuke the pid file and restart after checking
the shmmem segment listings.  I believe Tom Lane recently made the safety
check in 8.0 is a lot smarter than prior versions.  I vaguely recall he
posted the patch a month or three ago...

Ed


Re: Postgresql didn't start after power failure

От
Lonni J Friedman
Дата:
On Wed, 12 Jan 2005 17:08:26 -0300 (ART), Clodoaldo Pinto
<clodoaldo_pinto@yahoo.com.br> wrote:
> There was a power failure and then the postgresql service didn't start on
> system restart:
>
> System restart after power failure:
> Jan 12 16:49:06 s1 syslogd 1.4.1: restart.
> Jan 12 16:49:18 s1 su(pam_unix)[2098]: session opened for user postgres by
> (uid=0)
> Jan 12 16:49:18 s1 su(pam_unix)[2098]: session closed for user postgres
> Jan 12 16:49:19 s1 postgresql: Iniciando serviço postgresql :  failed
>
> When I manually rebooted the system postgres restarted:
> Jan 12 18:40:42 s1 su(pam_unix)[2083]: session opened for user postgres by
> (uid=0)
> Jan 12 18:40:43 s1 su(pam_unix)[2083]: session closed for user postgres
> Jan 12 18:40:44 s1 postgresql: Iniciando serviço postgresql :  succeeded
>
> /var/log/pgsql is empty and is chmoded as executable (?). It is an Anaconda
> install in FC2. Now up to 7.4.6.
>
> The last activity before power failure was a vacuum full and after that nothing
> at all for more than one hour.
> Is there anyway to know why did it not start and prevent it to happen again?
> How to configure it to write a log at system boot?

So its silently failing without logging anything?  Is it configured to
log to /var/log/pgsql in /etc/init.d/postgresql ?  Perhaps it left a
stale pid file behind?  Did you try running a 'postgresql service
stop' ?


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                                    netllama@gmail.com
LlamaLand                       http://netllama.linux-sxs.org