title: Supervisor - Can't start supervisorctl as root or user (User is set in config)
body: <p>I start supervisor as root:</p>
  
  <p><code>sudo supervisord -c /etc/supervisor/supervisord.conf</code></p>
  
  <p>Then I try to start up supervisorctl:</p>
  
  <pre><code>(myapp)appuser@ip-172-31-21-65:~/appuser$ supervisorctl -c /etc/supervisor/supervisord.conf
  </code></pre>
  
  <p>Supervisor starts with the following mesage:</p>
  
  <pre><code>error: &lt;class 'socket.error'&gt;, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 224
  </code></pre>
  
  <p>Trying to run the second command as root is also unsuccessful. My understanding is that this is by design.</p>
  
  <p>All the advice I find suggests that I should set my user as the user that executes the command, but this is already how I have it all configured:</p>
  
  <p>Here is the script file that I am using:</p>
  
  <pre><code>NAME="myapp"                              
  DJANGODIR=/home/appuser/myapp             
  SOCKFILE=/home/appuser/myapp/gunicorn.sock        
  USER=appuser                                        
  GROUP=webdata                                     
  NUM_WORKERS=1                                     
  DJANGO_SETTINGS_MODULE=myapp.settings             
  DJANGO_WSGI_MODULE=myapp.wsgi  
  </code></pre>
  
  <p>I'm not sure what is screwing it up? I think it might be the <code>GROUP</code> setting, as I don't recognize that value. But if I comment it out, it doesn't seem to make a difference. How should I troubleshoot this?</p>
  
  <p>EDIT: I created a group named <code>supervisor</code>, added <code>appuser</code> to it and changed the <code>GROUP</code> setting to match, but still no joy. </p>
  
  <p>This is my supervisord.conf:</p>
  
  <pre><code>; supervisor config file
  
  [unix_http_server]
  file=/var/run/supervisor.sock   ; (the path to the socket file)
  chmod=0700                       ; sockef file mode (default 0700)
  
  [supervisord]
  logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/super$
  pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
  childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TE$
  
  [rpcinterface:supervisor]
  supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
  
  [supervisorctl]
  serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket
  
  [include]
  files = /etc/supervisor/conf.d/*.conf
  </code></pre>
  
  <p>And my configuration file for the app:</p>
  
  <pre><code>[program:myapp]
  command = /home/appuser/myapp/gunicorn_start.sh ; Command to start app
  user = appuser ; User to run as
  stdout_logfile = /home/appuser/myapp/logs/supervisor.log ; Where to write$
  redirect_stderr = true ; Save stderr in the same log
  environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 ; Set UTF-8 as default encoding
  </code></pre>
  
  <p>My supervisor version is:</p>
  
  <pre><code>&gt;supervisord --version
  3.0b2
  </code></pre>