title: Celery beat using supervisor in production
body: <p>I am trying to run celery beat from my virtual env using supervisor. The script doesn't seem to work</p>
  
  <p>All my supervisor scripts are in the directory <code>/etc/supervisord</code>
  It has a <code>supervisord.conf</code> file and directory <code>conf.d</code> which contains the file <code>Gorgon-celery.conf</code></p>
  
  <p>My <code>supervisord.conf</code> file looks like this:</p>
  
  <pre><code>[unix_http_server]
  file=/tmp/supervisor.sock   ; (the path to the socket file)
  
  [supervisord]
  logfile=/var/log/supervisord/main.log ; (main log file;default $CWD/supervisord.log)
  logfile_maxbytes=50MB        ; (max main logfile bytes b4 rotation;default 50MB)
  logfile_backups=10           ; (num of main logfile rotation backups;default 10)
  loglevel=info                ; (log level;default info; others: debug,warn,trace)
  pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
  nodaemon=false               ; (start in foreground if true;default false)
  minfds=1024                  ; (min. avail startup file descriptors;default 1024)
  minprocs=200                 ; (min. avail process descriptors;default 200)
  childlogdir=/var/log/supervisord            ; ('AUTO' child log dir, default $TEMP)
  
  [rpcinterface:supervisor]
  supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
  
  [supervisorctl]
  serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL  for a unix socket
  
  [include]
  files = /etc/supervisord/conf.d/*.conf
  </code></pre>
  
  <p>My <code>Gorgon-celery.conf</code> file looks like this:</p>
  
  <pre><code>[program:Gorgon-celery]
  command=cd /home/ubuntu/sites/source &amp;&amp; source ../virtualenv/bin/activate &amp;&amp; celery -A Gorgon worker
  environment=PYTHONPATH=/home/ubuntu/sites/virtualenv/bin
  directory=/home/ubuntu/sites/source
  numprocs=1
  stdout_logfile=/var/log/celeryd/Gorgon.log
  stderr_logfile=/var/log/celeryd/Gorgon.log
  autostart=true
  autorestart=true
  startsecs=10
  stopwaitsecs = 600
  
  [program:Gorgon-celerybeat]
  command=cd /home/ubuntu/sites/source &amp;&amp; source ../virtualenv/bin/activate &amp;&amp; celery -A Gorgon beat --max-interval=10
  environment=PYTHONPATH=/home/ubuntu/sites/virtualenv/bin
  directory=/home/ubuntu/sites/source
  numprocs=1
  stdout_logfile=/var/log/celeryd/Gorgon-beat.log
  stderr_logfile=/var/log/celeryd/Gorgon-beat.log
  autostart=true
  autorestart=true
  startsecs=10
  stopwaitsecs = 600
  </code></pre>
  
  <p>Finally to the supervisor, I am using the command: <code>sudo supervisord -c /etc/supervisord/supervisord.conf</code></p>