New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supervisord Starts All Processes at the Same Time #122

Open
fredpalmer opened this Issue May 30, 2012 · 204 comments

Comments

@fredpalmer

fredpalmer commented May 30, 2012

My config:

[program:redis-testapp]
command=/opt/bcs/bin/redis-server /apps/testapp/releases/current/environments/all/redis.conf
stdout_logfile=/var/log/redis_testapp_log
stderr_logfile=/var/log/redis_testapp_log
startsecs=30
priority=1
autostart=true
autorestart=true

[program:celerybeat-testapp]
command=python -O manage.py celerybeat --loglevel=INFO --schedule=/apps/testapp/db/celerybeat_schedule_db
stdout_logfile=/var/log/celerybeat_testapp_log
stderr_logfile=/var/log/celerybeat_testapp_log
priority=999
startsecs=5
autostart=true

[program:celery-testapp]
command=python -O manage.py celeryd --loglevel=INFO --events
stdout_logfile=/var/log/celeryd_testapp_log
stderr_logfile=/var/log/celeryd_testapp_log
priority=100
startsecs=10
autostart=true

[program:gunicorn-testapp]
command=gunicorn_django --workers=10 --log-level info --timeout 500 --bind=127.0.0.1:8004
stdout_logfile=/var/log/gunicorn_testapp_log
stderr_logfile=/var/log/gunicorn_testapp_log
priority=999
startsecs=10
autostart=true

[program:memcached-testapp]
command=/opt/bcs/bin/memcached -m 128 -l 127.0.0.1 -p 11212 -u nobody -P /apps/testapp/run/memcached.pid
stdout_logfile=/var/log/memcached_testapp_log
stderr_logfile=/var/log/memcached_testapp_log
priority=11
autostart=true
autorestart=true


My output =>

2012-05-30 22:37:33,181 INFO daemonizing the supervisord process
2012-05-30 22:37:33,182 INFO supervisord started with pid 16230
2012-05-30 22:37:34,195 INFO spawned: 'redis-testapp' with pid 16232
2012-05-30 22:37:34,206 INFO spawned: 'memcached-testapp' with pid 16233
2012-05-30 22:37:34,214 INFO spawned: 'celery-testapp' with pid 16234
2012-05-30 22:37:34,238 INFO spawned: 'celerybeat-testapp' with pid 16235
2012-05-30 22:37:34,477 INFO spawned: 'gunicorn-testapp' with pid 16241
2012-05-30 22:37:35,240 INFO success: memcached-testapp entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2012-05-30 22:37:39,434 INFO success: celerybeat-testapp entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
2012-05-30 22:37:44,434 INFO success: celery-testapp entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
2012-05-30 22:37:44,435 INFO success: gunicorn-testapp entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
2012-05-30 22:38:04,197 INFO success: redis-testapp entered RUNNING state, process has stayed up for > than 30 seconds (startsecs)

What I expected to happen =>

redis would start and supervisord would wait 30 seconds before starting any lower priority processes.

@mnaberez mnaberez closed this May 30, 2012

@disposable-ksa98

This comment has been minimized.

Show comment
Hide comment
@disposable-ksa98

disposable-ksa98 Jul 2, 2013

I don't see what's the point of using supervisor if it does not get this right.

@mnaberez If there is an open issue for this, you should post the link so we can find it.

disposable-ksa98 commented Jul 2, 2013

I don't see what's the point of using supervisor if it does not get this right.

@mnaberez If there is an open issue for this, you should post the link so we can find it.

@mnaberez mnaberez reopened this Jul 2, 2013

@rca

This comment has been minimized.

Show comment
Hide comment
@rca

rca Jul 9, 2013

I also need the ability to start processes in a particular order.

An event-based approach could work. For example, if I have a [program:agent] and a [program:client] I could subscribe the client to start up when the agent emits a started event. By default, if a program does not subscribe to any event, it will be started when supervisord starts.

rca commented Jul 9, 2013

I also need the ability to start processes in a particular order.

An event-based approach could work. For example, if I have a [program:agent] and a [program:client] I could subscribe the client to start up when the agent emits a started event. By default, if a program does not subscribe to any event, it will be started when supervisord starts.

@sevastos

This comment has been minimized.

Show comment
Hide comment
@sevastos

sevastos commented Mar 3, 2014

+1

@maximilize

This comment has been minimized.

Show comment
Hide comment
@maximilize

maximilize commented Mar 6, 2014

+1

@tomislacker

This comment has been minimized.

Show comment
Hide comment
@tomislacker

tomislacker commented Apr 9, 2014

+1

@dmitriy-kiriyenko

This comment has been minimized.

Show comment
Hide comment
@dmitriy-kiriyenko

dmitriy-kiriyenko Apr 21, 2014

+1, this major issue.

dmitriy-kiriyenko commented Apr 21, 2014

+1, this major issue.

@jefferai

This comment has been minimized.

Show comment
Hide comment
@jefferai

jefferai commented Apr 22, 2014

+1

@hunterloftis

This comment has been minimized.

Show comment
Hide comment
@hunterloftis

hunterloftis commented Apr 22, 2014

+1

@orarbel

This comment has been minimized.

Show comment
Hide comment
@orarbel

orarbel commented May 1, 2014

+1

@abierbaum

This comment has been minimized.

Show comment
Hide comment
@abierbaum

abierbaum commented May 2, 2014

+1

@gigaroby

This comment has been minimized.

Show comment
Hide comment
@gigaroby

gigaroby commented May 13, 2014

+1

@KenjiTakahashi

This comment has been minimized.

Show comment
Hide comment
@KenjiTakahashi

KenjiTakahashi commented May 14, 2014

👍

@karanlyons

This comment has been minimized.

Show comment
Hide comment
@karanlyons

karanlyons commented May 30, 2014

+1

@voleg

This comment has been minimized.

Show comment
Hide comment
@voleg

voleg commented Jun 10, 2014

+1

@toxsick

This comment has been minimized.

Show comment
Hide comment
@toxsick

toxsick commented Jun 10, 2014

+1

@harmy

This comment has been minimized.

Show comment
Hide comment
@harmy

harmy Jun 13, 2014

must have

harmy commented Jun 13, 2014

must have

@xbeta

This comment has been minimized.

Show comment
Hide comment
@xbeta

xbeta Jun 23, 2014

is there a dependency in supervisor? if not, why not?

xbeta commented Jun 23, 2014

is there a dependency in supervisor? if not, why not?

@analytically

This comment has been minimized.

Show comment
Hide comment
@analytically

analytically commented Jun 27, 2014

+1

@devrim

This comment has been minimized.

Show comment
Hide comment
@devrim

devrim commented Jul 8, 2014

+1

@alp82

This comment has been minimized.

Show comment
Hide comment
@alp82

alp82 commented Jul 10, 2014

+1

@mtrienis

This comment has been minimized.

Show comment
Hide comment
@mtrienis

mtrienis commented Aug 12, 2014

+1

@Pindar

This comment has been minimized.

Show comment
Hide comment
@Pindar

Pindar commented Sep 2, 2014

+1

@miguno

This comment has been minimized.

Show comment
Hide comment
@miguno

miguno Sep 3, 2014

Not wanting to add to any perceived pressure, but I'd be +1 on the very same feature (process dependencies). :-)

miguno commented Sep 3, 2014

Not wanting to add to any perceived pressure, but I'd be +1 on the very same feature (process dependencies). :-)

@nand0p

This comment has been minimized.

Show comment
Hide comment
@nand0p

nand0p Sep 4, 2014

this would be very useful and mean less ugly hacks like sleep

nand0p commented Sep 4, 2014

this would be very useful and mean less ugly hacks like sleep

@jowenn

This comment has been minimized.

Show comment
Hide comment
@jowenn

jowenn commented Sep 6, 2014

+1

@pangon

This comment has been minimized.

Show comment
Hide comment
@pangon

pangon commented Sep 14, 2014

+1

@ricardosasilva

This comment has been minimized.

Show comment
Hide comment
@ricardosasilva

ricardosasilva Sep 15, 2014

+1. Maybe an option to turn the process loading synchronous.

ricardosasilva commented Sep 15, 2014

+1. Maybe an option to turn the process loading synchronous.

@livelace

This comment has been minimized.

Show comment
Hide comment
@livelace

livelace commented Feb 9, 2017

+1

@keyndark

This comment has been minimized.

Show comment
Hide comment
@keyndark

keyndark commented Feb 22, 2017

+1

@alexhudici

This comment has been minimized.

Show comment
Hide comment
@alexhudici

alexhudici commented Feb 23, 2017

+1

@FAKERINHEART

This comment has been minimized.

Show comment
Hide comment
@FAKERINHEART

FAKERINHEART Feb 24, 2017

https://github.com/FAKERINHEART/supervisor
See the Introduction.txt and use the branch dev-3.3.1-sr1.
I have had this branch with dependency features among groups(programs) for supervisor, which is partly based on the codes suggested by @vladfr .
If you find any bugs, please tell me in time.

FAKERINHEART commented Feb 24, 2017

https://github.com/FAKERINHEART/supervisor
See the Introduction.txt and use the branch dev-3.3.1-sr1.
I have had this branch with dependency features among groups(programs) for supervisor, which is partly based on the codes suggested by @vladfr .
If you find any bugs, please tell me in time.

@shindu

This comment has been minimized.

Show comment
Hide comment
@shindu

shindu commented Mar 21, 2017

+1

@prapdm

This comment has been minimized.

Show comment
Hide comment
@prapdm

prapdm commented Mar 23, 2017

+1

@Clamb94

This comment has been minimized.

Show comment
Hide comment
@Clamb94

Clamb94 commented Apr 6, 2017

+1

@orrery

This comment has been minimized.

Show comment
Hide comment
@orrery

orrery Apr 17, 2017

This issue has been open since 2012, does anyone have ownership over it? It's clearly important to many users; is there any consensus amongst supervisor contributors?

orrery commented Apr 17, 2017

This issue has been open since 2012, does anyone have ownership over it? It's clearly important to many users; is there any consensus amongst supervisor contributors?

@swapdavv

This comment has been minimized.

Show comment
Hide comment
@swapdavv

swapdavv commented May 3, 2017

+1

@Constantin07

This comment has been minimized.

Show comment
Hide comment
@Constantin07

Constantin07 commented Jul 21, 2017

+1

@bogdanm

This comment has been minimized.

Show comment
Hide comment
@bogdanm

bogdanm commented Aug 21, 2017

+1

@orrery

This comment has been minimized.

Show comment
Hide comment
@orrery

orrery Aug 21, 2017

someone on the supervisor project needs to take ownership of this, or close the ticket with a reasonable reason for why this won't be addressed e.g. perhaps it doesn't need to be addressed because supervisor can re-attempt a restart on an error condition (a solution that has worked for me).

This issue has been open since 2012 and it's getting kind of ridiculous that a ticket would remain open for this length of time.

orrery commented Aug 21, 2017

someone on the supervisor project needs to take ownership of this, or close the ticket with a reasonable reason for why this won't be addressed e.g. perhaps it doesn't need to be addressed because supervisor can re-attempt a restart on an error condition (a solution that has worked for me).

This issue has been open since 2012 and it's getting kind of ridiculous that a ticket would remain open for this length of time.

@greenaussie

This comment has been minimized.

Show comment
Hide comment
@greenaussie

greenaussie commented Sep 14, 2017

+1...

@ecebuzz

This comment has been minimized.

Show comment
Hide comment
@ecebuzz

ecebuzz commented Oct 24, 2017

+1

@pickledgator

This comment has been minimized.

Show comment
Hide comment
@pickledgator

pickledgator commented Oct 24, 2017

+1

@chezbut

This comment has been minimized.

Show comment
Hide comment
@chezbut

chezbut commented Dec 6, 2017

+1

@AlecBenzer

This comment has been minimized.

Show comment
Hide comment
@AlecBenzer

AlecBenzer Dec 6, 2017

FYI: replying to an issue just to say '+1' sends a notification to everyone subscribed to the issue. You can just react to the issue's initial comment with the 👍 emoji instead.

plus_1_github

AlecBenzer commented Dec 6, 2017

FYI: replying to an issue just to say '+1' sends a notification to everyone subscribed to the issue. You can just react to the issue's initial comment with the 👍 emoji instead.

plus_1_github

@AndrewSav

This comment has been minimized.

Show comment
Hide comment
@AndrewSav

AndrewSav Dec 6, 2017

@AlecBenzer

FYI: replying to an issue just to say '+1' sends a notification to everyone subscribed to the issue.

But that's kind of the point, is not it? I'm subscribed to this issue, and I'm very interested to see that other people are interested is well. This issue is more than 5 years old. It is a good thing to actually ping the developers to gently remind them that people are still interested. It is also good for those who subscribed, to confirm that there are also others who care, not just that person ;)

FYI: There is an "Unsubscribe" button to the right of the thread, if you do not like to receive the notification from this thread, this is perfectly fine, you can use this button to opt-out.

AndrewSav commented Dec 6, 2017

@AlecBenzer

FYI: replying to an issue just to say '+1' sends a notification to everyone subscribed to the issue.

But that's kind of the point, is not it? I'm subscribed to this issue, and I'm very interested to see that other people are interested is well. This issue is more than 5 years old. It is a good thing to actually ping the developers to gently remind them that people are still interested. It is also good for those who subscribed, to confirm that there are also others who care, not just that person ;)

FYI: There is an "Unsubscribe" button to the right of the thread, if you do not like to receive the notification from this thread, this is perfectly fine, you can use this button to opt-out.

@LMCom

This comment has been minimized.

Show comment
Hide comment
@LMCom

LMCom Dec 12, 2017

I can confirm, that starting processes in a specific order is an important requirement. Sorry, I was not able to confirm it earlier. Will it be implemented now?

LMCom commented Dec 12, 2017

I can confirm, that starting processes in a specific order is an important requirement. Sorry, I was not able to confirm it earlier. Will it be implemented now?

@jkemp101

This comment has been minimized.

Show comment
Hide comment
@jkemp101

jkemp101 Dec 12, 2017

Sharing my solution to this problem, your mileage may vary. While waiting for this to be fixed I transitioned most of the pieces of our infrastructure relying on this feature to Docker/Kubernetes. The various Docker orchestration frameworks (docker-compose, swarm, Kubernetes, etc) typically have mechanisms to control startup ordering (often with their own set of challenges). So if you are waiting for this to be fixed maybe use it as an excuse to play around with a simple docker-compose project to see if it provides an alternative approach to this problem. I recognize this may only apply to a small fraction of the users waiting for this to be fixed.

jkemp101 commented Dec 12, 2017

Sharing my solution to this problem, your mileage may vary. While waiting for this to be fixed I transitioned most of the pieces of our infrastructure relying on this feature to Docker/Kubernetes. The various Docker orchestration frameworks (docker-compose, swarm, Kubernetes, etc) typically have mechanisms to control startup ordering (often with their own set of challenges). So if you are waiting for this to be fixed maybe use it as an excuse to play around with a simple docker-compose project to see if it provides an alternative approach to this problem. I recognize this may only apply to a small fraction of the users waiting for this to be fixed.

@bendikro

This comment has been minimized.

Show comment
Hide comment
@bendikro

bendikro Mar 2, 2018

Hi everyone

I've implemented an event plugin with support for starting services in order specified by dependent services.
Take a look at this example.

https://github.com/bendikro/supervisord-dependent-startup

bendikro commented Mar 2, 2018

Hi everyone

I've implemented an event plugin with support for starting services in order specified by dependent services.
Take a look at this example.

https://github.com/bendikro/supervisord-dependent-startup

@CoryPulm

This comment has been minimized.

Show comment
Hide comment
@CoryPulm

CoryPulm Mar 26, 2018

An alternative to @bendikro's awesome plugin could also be the Docker community's wait-for-it.sh script. It's a bit easier to set up if you have a complex automation system managing it, though it isn't as pretty as a native plugin:
https://github.com/vishnubob/wait-for-it

CoryPulm commented Mar 26, 2018

An alternative to @bendikro's awesome plugin could also be the Docker community's wait-for-it.sh script. It's a bit easier to set up if you have a complex automation system managing it, though it isn't as pretty as a native plugin:
https://github.com/vishnubob/wait-for-it

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