PostgreSQL - Server doesn't listen message

Hello

I am a bit confused. I get the attached Server doesn’t listen message when (re)starting our Server (Mac OS X 10.4.11) and trying to connect to the PostgreSQL database (with our Servoy app TrackIT or pgAdmin). The postgresql processes are started automatically at server startup.

When I restart the db processes in the terminal (with sudo SystemStarter stop/start PostgreSQL) the database accepts connections (again). Quite strange. This is reproducable.

Now back to the Guru hint (Server not listening). What have you PostgreSQL guys set for the parameter listen_addresses? Is it save to set * if all remote connections occur via VPN? Up to now I have set (the default) localhost and it works (except as described above for the first time).

Any ideas?

Best regards, Robert

Servoy Developer
Version 3.5.5-build 518
Java version 1.5.0_13-121 (Mac OS X)
PostgreSQL 8.2.5

Hi Robert,

Robert Huber:
Hello

I am a bit confused. I get the attached Server doesn’t listen message when (re)starting our Server (Mac OS X 10.4.11) and trying to connect to the PostgreSQL database (with our Servoy app TrackIT or pgAdmin). The postgresql processes are started automatically at server startup.

When I restart the db processes in the terminal (with sudo SystemStarter stop/start PostgreSQL) the database accepts connections (again). Quite strange. This is reproducable.

That is very strange behavior. Do you perhaps have also a PostgreSQL startup item in LaunchAgents/LaunchDaemons besides the one in StartupItems ?

Robert Huber:
Now back to the Guru hint (Server not listening). What have you PostgreSQL guys set for the parameter listen_addresses? Is it save to set * if all remote connections occur via VPN? Up to now I have set (the default) localhost and it works (except as described above for the first time).

If you want to connect to it from other IP’s than localhost you need to use *.
In pg_hba.conf you give specific IP’s or IP ranges access to the database(s). If you don’t add IP’s to pg_hba.conf then you won’t be able to connect to it over TCP/IP.

Hope this helps.

Hi Robert

ROCLASI:
Hi Robert,
That is very strange behavior. Do you perhaps have also a PostgreSQL startup item in LaunchAgents/LaunchDaemons besides the one in StartupItems ?

I have only a startup item in the folder /Library/StartupItems. No startup stuff in the other folders. Actually nothing at all except a file called org.postgresql.postgres.plist in LaunchDaemons folder, but it has nothing to do with startup as far as I can see in it’s content.

ROCLASI:
If you want to connect to it from other IP’s than localhost you need to use *.
In pg_hba.conf you give specific IP’s or IP ranges access to the database(s). If you don’t add IP’s to pg_hba.conf then you won’t be able to connect to it over TCP/IP.

Hope this helps.

I’m not exactly sure what it means, but I can connect from clients and even remote clients via VPN, although the parameter listen_addresses is only a comment (not activated) in the postgresql.conf file, i. e. set to default ‘localhost’.

Thanks and best regards, Robert

Hi Robert,

Robert Huber:
I have only a startup item in the folder /Library/StartupItems. No startup stuff in the other folders. Actually nothing at all except a file called org.postgresql.postgres.plist in LaunchDaemons folder, but it has nothing to do with startup as far as I can see in it’s content.

Items in LaunchDaemons are part of the new Launchd system, the StartupItems folder is used by the older SystemStarter system. You have to use one or the other per daemon. Since the SystemStarter works I suggest you remove the plist out of the LaunchDaemon folder and restart to see if this solves it.

Robert Huber:
I’m not exactly sure what it means, but I can connect from clients and even remote clients via VPN, although the parameter listen_addresses is only a comment (not activated) in the postgresql.conf file, i. e. set to default ‘localhost’.

Maybe you can email the postgresql.conf and pg_hba.conf files to me so I can take a better look.

Hope this helps.

Hi Robert

The problem arised from the org.postgresql.postgres.plist file. And yes, it was there because I installed the version 8.3 but then went back to 8.2.5 and forgot (to be correct didn’t know .-) to remove the file in the LaunchDaemons folder.

Thanks, I will send you right now the config files.

Best regards, Robert

ROCLASI:
Hi Robert,

Robert Huber:
I have only a startup item in the folder /Library/StartupItems. No startup stuff in the other folders. Actually nothing at all except a file called org.postgresql.postgres.plist in LaunchDaemons folder, but it has nothing to do with startup as far as I can see in it’s content.

Items in LaunchDaemons are part of the new Launchd system, the StartupItems folder is used by the older SystemStarter system. You have to use one or the other per daemon. Since the SystemStarter works I suggest you remove the plist out of the LaunchDaemon folder and restart to see if this solves it.

Robert Huber:
I’m not exactly sure what it means, but I can connect from clients and even remote clients via VPN, although the parameter listen_addresses is only a comment (not activated) in the postgresql.conf file, i. e. set to default ‘localhost’.

Maybe you can email the postgresql.conf and pg_hba.conf files to me so I can take a better look.

Hope this helps.