Wednesday, February 18, 2015

supervisord in CentOS 7 (systemd version)

Hello,

Fast installation in CentOS 7 for this "helper" to the queues service in laravel or django framework. EPEL package too old so:
  1. yum install python-setuptools python-pip
  2. pip install supervisor
  3. mkdir -p /etc/supervisord
  4. echo_supervisord_conf > /etc/supervisor.d/supervisord.conf
  5. forked systemd init script  (thx to Jiangge Zhang) in /usr/lib/systemd/system/supervisord.service:


And: 
  1. systemctl enable supervisord
  2. systemctl start supervisord

User=nginx is useful to run this process as nginx user. You can change it but the user must be in the system.

7 comments:

  1. User=nginx seems like a typo

    Maybe you ment User=root or smth

    ReplyDelete
    Replies
    1. Hey Janno,

      At the end of the post you can read:

      User=nginx is useful to run this process as nginx user. You can change it but the user must be in the system.

      In my case, supervisord is controlling laravel jobs, laravel is running with nginx, nginx is running as nginx user.
      So, there is not any type here.

      thx for writing.

      Delete
  2. you have another typo:

    you write the config in /etc/supervisor.d, but the init script reference /etc/supervisord (without the dot)

    Really useful example, thanks!

    OP

    ReplyDelete
  3. Where do you store the configuration files for services to be managed by Supervisor, in this context?

    ReplyDelete
  4. I followed the same procedure but I am getting below issue:
    Failed at step EXEC spawning /usr/bin/supervisord: Permission denied

    ReplyDelete
  5. To use Supervisord in CentOS 7 with systemd, Host Bet install it (yum install -y supervisor), enable it (systemctl enable supervisord), and start it (systemctl start supervisord).






    ReplyDelete