[Pkg-postgresql-public] Bug#699911: postgresql-common: init.d start script quits if a pg cluster cannot be started so clusters after this pg cluster will also not start

Frank Baalbergen frank.baalbergen at mendix.com
Wed Feb 6 16:09:10 UTC 2013


Package: postgresql-common
Version: 134wheezy2

I have four different Postgresql versions on a Debian Wheezy server.

# pg_lsclusters
Version Cluster   Port Status Owner    Data directory 
   Log file
8.4     main      5435 online postgres /var/lib/postgresql/8.4/main 
   /var/log/postgresql/postgresql-8.4-main.log
9.0     main      5436 online postgres /var/lib/postgresql/9.0/main 
   /var/log/postgresql/postgresql-9.0-main.log
9.1     main      5432 online postgres /var/lib/postgresql/9.1/main 
   /var/log/postgresql/postgresql-9.1-main.log
9.2     main      5433 online postgres /var/lib/postgresql/9.2/main 
   /var/log/postgresql/postgresql-9.2-main.log

When i change postgresql 9.0, on a way that postgresql 9.0 cannot be 
started. The third (9.1/main) and fourth(9.2/main) cluster won't start 
anymore when using /etc/init.d/postgresql start, /etc/init.d/postgresql 
start is ran on a system boot.

To test this, i changed the unix_socket_directory of the postgresql 9.0 
cluster (second cluster).

-unix_socket_directory = '/var/run/postgresql'          # (change 
requires restart)
+unix_socket_directory = '/var/run/postgresql-thisdoesnotexist' 
# (change requires restart)

# /etc/init.d/postgresql stop
[ ok ] Stopping PostgreSQL 8.4 database server: main.
[ ok ] Stopping PostgreSQL 9.0 database server: main.
[ ok ] Stopping PostgreSQL 9.1 database server: main.
[ ok ] Stopping PostgreSQL 9.2 database server: main.

# /etc/init.d/postgresql start
[ ok ] Starting PostgreSQL 8.4 database server: main.
[....] Starting PostgreSQL 9.0 database server: main[....] The 
PostgreSQL server failed to start. Please check the log output: 
2013-02-06 12:11:32 CET FATAL: could not create lock file 
"/var/run/postgresql-thisdo[FAILexist/.s.PGSQL.5436.lock": No such file 
or directory ... failed!
  failed!
#

As you can see, the /etc/init.d/postgresql quits after a fatal error. 
This means that the rest of the clusters won't start as well.

# pg_lsclusters
Version Cluster   Port Status Owner    Data directory 
   Log file
8.4     main      5435 online postgres /var/lib/postgresql/8.4/main 
   /var/log/postgresql/postgresql-8.4-main.log
9.0     main      5436 down   postgres /var/lib/postgresql/9.0/main 
   /var/log/postgresql/postgresql-9.0-main.log
9.1     main      5432 down   postgres /var/lib/postgresql/9.1/main 
   /var/log/postgresql/postgresql-9.1-main.log
9.2     main      5433 down   postgres /var/lib/postgresql/9.2/main 
   /var/log/postgresql/postgresql-9.2-main.log

I think it would be better to give up on the 9.0/main cluster and try to 
start the 9.1/main cluster and the 9.2/main cluster in this case.

-- 
Frank Baalbergen - System / Network Engineer
T +31 (0)10 2760434 | frank.baalbergen at mendix.com | www.mendix.com



More information about the Pkg-postgresql-public mailing list