Skip to content

Instantly share code, notes, and snippets.

@mozillazg
Forked from tonyseek/supervisord.service
Last active December 1, 2023 12:59
Show Gist options
  • Save mozillazg/6cbdcccbf46fe96a4edd to your computer and use it in GitHub Desktop.
Save mozillazg/6cbdcccbf46fe96a4edd to your computer and use it in GitHub Desktop.
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
User=root
[Install]
WantedBy=multi-user.target
  1. install: pip install supervisor
  2. configure:
    1. mkdir -p /etc/supervisord/conf.d
    2. echo_supervisord_conf > /etc/supervisord/supervisord.conf
    3. echo "files = conf.d/*.conf" >> /etc/supervisord/supervisord.conf
  3. setup as service: wget supervisord.service -O /usr/lib/systemd/system/supervisord.service
  4. start service systemctl start supervisord
  5. view service status: systemctl status supervisord
  6. auto start service on system startup: systemctl enable supervisord
@Krato
Copy link

Krato commented Aug 9, 2017

Yes this line is incorrect

@hcira
Copy link

hcira commented Oct 24, 2017

Copy content from file below ;)

@vafrcor
Copy link

vafrcor commented Dec 22, 2017

any fix about this error?

@skecskes
Copy link

Thanks for sharing. Guys, the third step is says to download file, but path is missing. Either use full path:
wget https://gist.githubusercontent.com/mozillazg/6cbdcccbf46fe96a4edd/raw/2f5c6f5e88fc43e27b974f8a4c19088fc22b1bd5/supervisord.service -O /usr/lib/systemd/system/supervisord.service
or create the file with above content in folder: /usr/lib/systemd/system/supervisord.service

@aleksandrychev
Copy link

aleksandrychev commented Feb 4, 2018

Thanks a lot! Works fine!

@alioguzhan
Copy link

Thanks. One thing -> You may need to run systemctl daemon-reload before running systemctl start supervisord

@HouCoder
Copy link

Thanks, this post is VERY helpful.

@michielgerritsen
Copy link

I had to change ;[include] to [include] for this to work.

@bllli
Copy link

bllli commented Feb 19, 2019

@michielgerritsen I had to change ;[include] to [include] for this to work.

fix mine
thank you

@wweeder
Copy link

wweeder commented Apr 2, 2019

Ty, very useful. Saved me from a headache.

@farlandliu
Copy link

nice, thank you!

@secsilm
Copy link

secsilm commented Apr 23, 2019

It's helpful. Thank you!

BTW, let me sum it up, If you failed with the message:

Job for supervisord.service failed because the control process exited with error code.

You can try these steps:

  1. change ;[include] to [include] in supervisord.service
  2. change /bin/supervisord and /bin/supervisorctl to your own location in supervisord.service, if your supervisor is not installed in this location. You can use which supervisord and which supervisorctl to check your own location.
  3. systemctl daemon-reload
  4. systemctl start supervisord

@marcoxsurf
Copy link

marcoxsurf commented Oct 18, 2019

command: echo_supervisord_conf > /etc/supervisord/supervisord.conf should be
echo_supervisord_conf > /etc/supervisor/supervisord.conf.
/etc/supervisord is not in the lookup dir list.

@kenzouno1
Copy link

sometime supervisor on my server not working. I checking file /usr/lib/systemd/system/supervisord.service show is empty file. Can someone help me?

@aramhamidi
Copy link

aramhamidi commented Mar 19, 2020

It's helpful. Thank you!

BTW, let me sum it up, If you failed with the message:

Job for supervisord.service failed because the control process exited with error code.

You can try these steps:

  1. change ;[include] to [include] in supervisord.service
  2. change /bin/supervisord and /bin/supervisorctl to your own location in supervisord.service, if your supervisor is not installed in this location. You can use which supervisord and which supervisorctl to check your own location.
  3. systemctl daemon-reload
  4. systemctl start supervisord

I am facing this issue right now, but I am wondering, do you mean to "change ;[include] to [include] in supervisord.service" or in supervisord.conf ??

@imtiyazsizmic
Copy link

Thanks, it's really helpful.

Who is still struggling to make this work?

Please check your folder name is it "supervisor" or "supervisord", notice "d" at last.

You need to check the folder name for all the steps under configure section of usage.md and line no. 8 under supervisord.service file

Line no 8: ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment