Postgres connection failure when running node app using supervisor
<p>I have nodejs webapp with postresql. I am running this using <a href="http://supervisord.org/" rel="nofollow noreferrer">supervisord</a> on the server. The problem is that the postgresql login from nodejs is failing. The error message is:</p>

<p><code>no PostgreSQL user name specified in startup packet</code></p>

<p>which basically means no user name is being passed from the webapp while connecting to the db. </p>

<p>Note that I am using unix socket for connecting to postgres from my webapp.</p>

<p>My <code>webapp1.conf</code> looks like:</p>

<pre><code>[program:webapp1]
user=webapp1
command = node /home/webapp1/projects/webapp1/app.js
directory = /home/webapp1/projects/webapp1
autostart = true
autorestart = true
stdout_logfile = /var/log/supervisor/webapp1.log
stderr_logfile = /var/log/supervisor/webapp1_err.log
</code></pre>

<p>I have confirmed that supervisor is running the webapp is running under user <code>webapp1</code>.</p>

<p>One more thing - if I start my webapp by logging in as user <code>webapp1</code>, it works.</p>