Thread: Service startup - troubleshooting

Service startup - troubleshooting

From
"Mike"
Date:
Hello,

I know this is probably a borderline Linux question but I think
someone with PostgreSQL expertise will better be able to answer it (I
already struck out on the Linux side and after much searching on the
Web).

I installed Postgres 8.1 on Ubuntu 6.10 using Synaptic. Postgres is
listed under System|Administration|Services in the UI, and there's an
init script (which references /usr/share/postgresql-common/init.d-
functions) in the appropriate run level directory. However, Postgres
still won't run at startup.

I've searched various log files for any messages from Postgres but
found none. My guess would be that this is a permission-related
problem, but I don't know for sure.

Can anyone share ideas on how to troubleshoot the (non-) starting of
Postgres at boot time and how to resolve this problem?

Thank you!


Re: Service startup - troubleshooting

From
Richard Huxton
Date:
Mike wrote:
> Hello,
>
> I know this is probably a borderline Linux question but I think
> someone with PostgreSQL expertise will better be able to answer it (I
> already struck out on the Linux side and after much searching on the
> Web).
>
> I installed Postgres 8.1 on Ubuntu 6.10 using Synaptic. Postgres is
> listed under System|Administration|Services in the UI, and there's an
> init script (which references /usr/share/postgresql-common/init.d-
> functions) in the appropriate run level directory. However, Postgres
> still won't run at startup.

As root, try running:
   /etc/init.d/postgresql status
If that says it's running, check with ps, otherwise try
   /etc/init.d/postgresql start
Error messages should be printed to console or to a log somewhere like
/var/log/postgresql


--
   Richard Huxton
   Archonet Ltd

Re: Service startup - troubleshooting

From
"Mike"
Date:
Hi Richard,

Thanks for your response.

Below is a console session (again, this is on Ubuntu). I attempt to
run the init script but can't start Postgres and don't see any error
messages in the console or output in the log directory.

I then switch to the 'postgres' user and can run pg_ctl to start
Postgres.

I imagine the configuration was mangled somewhere down the line.
Perhaps I need to reinstall Ubuntu, though it's not something I look
forward to (I already tried uninstalling Postgres and wiping away all
references to it prior to my last install).

Thanks for taking a look!

-------------------------------------------------------------------------
myuser@mycomputer:~$ sudo /etc/init.d/postgresql-8.1 status
Password:
Version Cluster   Port Status Owner    Data
directory                     Log file
myuser@mycomputer:~$ sudo /etc/init.d/postgresql-8.1 start -D /usr/
local/pgsql/data
myuser@mycomputer:~$ sudo /etc/init.d/postgresql-8.1 status
Version Cluster   Port Status Owner    Data
directory                     Log file
myuser@mycomputer:~$ ls -a /var/log/postgresql
.  ..
myuser@mycomputer:~$ su postgres
Password:
postgres@mycomputer:/home/myuser$ /etc/init.d/postgresql-8.1 start -D /
usr/local/pgsql/data
postgres@mycomputer:/home/myuser$ /etc/init.d/postgresql-8.1 status
Version Cluster   Port Status Owner    Data
directory                     Log file
postgres@mycomputer:/home/myuser$ pg_ctl -D /usr/local/pgsql/data
start
could not change directory to "/home/myuser"
postmaster starting
postgres@mycomputer:/home/myuser$ LOG:  database system was shut down
at 2007-02-08 14:08:58 EST
LOG:  checkpoint record is at 0/4BCDD4
LOG:  redo record is at 0/4BCDD4; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 1492; next OID: 16740
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system is ready
LOG:  transaction ID wrap limit is 2147484146, limited by database
"postgres"


Re: Service startup - troubleshooting

From
"Andrew J. Kopciuch"
Date:
> I imagine the configuration was mangled somewhere down the line.
> Perhaps I need to reinstall Ubuntu, though it's not something I look
> forward to (I already tried uninstalling Postgres and wiping away all
> references to it prior to my last install).
>
> Thanks for taking a look!
>
> -------------------------------------------------------------------------
> myuser@mycomputer:~$ sudo /etc/init.d/postgresql-8.1 status
> Password:
> Version Cluster   Port Status Owner    Data
> directory                     Log file

This shows that you do not have a cluster.

try running

sudo pg_createcluster 8.1 main

> myuser@mycomputer:~$ sudo /etc/init.d/postgresql-8.1 start -D /usr/
> local/pgsql/data

sudo /etc/init.d/postgresql-8.1 start

is all you should need.  Give that a try first, and the confirm you actually
have a cluster with

sudo /etc/init.d/postgresql-8.1 status

> myuser@mycomputer:~$ sudo /etc/init.d/postgresql-8.1 status
> Version Cluster   Port Status Owner    Data
> directory                     Log file
> myuser@mycomputer:~$ ls -a /var/log/postgresql
> .  ..

That seems strange.  It appears that your installation is missing something.

What do you get from :

dpkg -l *postgresql*




Andy