Hi everyone,

First of all it's appears that there was something wrong with my Upstart conf file (Ubuntu is using Upstart instead of SysV init. Next year they'll also move to Systemd). Jay and Raghu: That solved my connection problem and /var/run problem.
So now pg is up (according to ps -aux |grep post). However pg_ctl status says no server is running. What's wrong?

About the logs: I have pg_xlog and pg_clog under PFDATA - nothing there.

Remote connection: When I try to connect to the server I get an error that my user is not present at pg_hba.conf. However, I see that I have 2 such files: One in PGDATA and one in /etc/postgresql/9.3/main/. What's the difference between them?

Thanks


On 10/18/2014 03:48 AM, jayknowsunix@gmail.com wrote:
Hi Shay,

Per your questions:
1) from my experience, /var/run is only used to write a PID file, but this file is usually only created by your system's service commands. I don't use Ubuntu, only CentOS, so my command is "service postgresql-9.3 [start | stop | status| ... ] and the script writes the PID file. The CentOS script also writes out a /var/subsys/lock file for postgresql.
2) your logfiles, unless you've butchered the postgresql.conf file, live in the $PGDATA/pg_log directory. Wherever that is on your system.
3) i probably can't help much here, but first if you're running selinux, I'd probably turn that off first. Next, check if iptables is running and possibly blocking your response. Either turn that off or add a rule to permit this port.

Hope this helps,
Jay

Sent from my iPad

On Oct 17, 2014, at 6:12 PM, Shay Gover <shay@kapotamar.com> wrote:

Hello everybody,

I've just installed PostgreSQL and I'm unable to connect to it remotely from my main desktop (I'm trying to connect with pgAdmin 3).

My setup:
Ubuntu Server 14.04 x64 (Azure Cloud)
PostgreSQL v9.3.5-0ubuntu0.14.04.1
contrib package is also installed.
PostgreSQL is started on boot using Upstart. I've modified this script: https://gist.github.com/haad/6020401 (just version numbers)

My Problems:
1) For some reason, when I've installed pg, /var/run/postgresql was missing. I've manually created this folder and gave my pg user write permissions. Is that a bug?
2) I've tried to change the log config in /etc/postgresql/9.3/main/postgresql.conf but it won't work. I think that pg is ignoring that file. I also have no idea where is pg log file (I tried /var/log/postgresql - not there). I tried starting the DB manually with pg_ctl -l but the log does say much:
    LOG:  database system is ready to accept connections
    LOG:  autovacuum launcher started
    LOG:  received SIGHUP, reloading configuration files
    LOG:  received smart shutdown request
    LOG:  autovacuum launcher shutting down
    LOG:  shutting down
    LOG:  database system is shut down
    LOG:  database system was shut down at 2014-10-17 21:22:11 UTC
    LOG:  database system is ready to accept connections
    LOG:  autovacuum launcher started
This log contains a single DB run.
3) I'm unable to connect from my main desktop. Server is listening according to netstat. There is no firewall on the server and I've created an Azure endpoint for port 5432. Ideas?

Can you help me?

Thanks,

--

Shay Gover
IT Consultant
Kapot Tamar


--

Shay Gover
IT Consultant
Kapot Tamar