title: Is postgresql running and where
body: <p>I am really lost on this one.  My Django application used to work and then suddenly stopped working, when I start the server I get this</p>
  
  <pre><code>django.db.utils.OperationalError: could not connect to server: Connection refused
  Is the server running on host "localhost" (127.0.0.1) and accepting
  TCP/IP connections on port 5432?
  </code></pre>
  
  <p>Fair enough, so now I want to check if postgres is running and on what port.  This is where I am lost as I can't find it running.  The following suggests that it is:</p>
  
  <p>service postgresql status</p>
  
  <pre><code>postgresql.service - PostgreSQL RDBMS
  Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
  Active: active (exited) since Thu 2017-11-16 13:29:37 GMT; 6s ago
  Process: 7023 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
  Main PID: 7023 (code=exited, status=0/SUCCESS)
  </code></pre>
  
  <p>This gives me some information
  ps aux | grep -i postgres</p>
  
  <pre><code>myuser+  7985  0.0  0.0  14228   976 pts/17   S+   13:38   0:00 grep --color=auto -i postgres
  </code></pre>
  
  <p>But I am unclear what it means, this gives me port details</p>
  
  <p>sudo netstat -plunt</p>
  
  <p>For example</p>
  
  <pre><code>roto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
  tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      1381/smbd       
  tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      791/redis-server 0.
  tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      2415/java       
  tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1211/nginx.conf 
  tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      841/dnsmasq     
  </code></pre>
  
  <p>The config file here: /etc/postgresql/9.5/main/postgresql.conf</p>
  
  <p>Says that Postgres should run on 5432</p>
  
  <p>My summary is that Postgres isn't running, but I am unsure where else to look to see any more information.  Can anyone help?</p>
  
  <p>Thanks</p>
  
  <p>Grant</p>