-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Comments
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. |
I also need the ability to start processes in a particular order. An event-based approach could work. For example, if I have a |
+1 |
2 similar comments
+1 |
+1 |
+1, this major issue. |
+1 |
8 similar comments
+1 |
+1 |
+1 |
+1 |
👍 |
+1 |
+1 |
+1 |
must have |
is there a dependency in supervisor? if not, why not? |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
Not wanting to add to any perceived pressure, but I'd be +1 on the very same feature (process dependencies). :-) |
this would be very useful and mean less ugly hacks like sleep |
+1 |
1 similar comment
+1 |
+1. Maybe an option to turn the process loading synchronous. |
+1 |
Please click the thumbs up on the original post instead of just commenting "+1". Gets my hopes up when I see a notification :D |
On option to solve this problem is to define in the supervisor.conf that the program will get autostart value of false for example: [program:test] Second step is to use bash script to start the supervisorctl example: Gnome-terminal -e “supervisord” *Thanks to Avner gidron for giving me the idea |
Hi, [program:zookeeper] [program:kafka] I want to start first Zookeeper and then Kafka when Zookeeper is up. This script is some times not working as expected. |
@kumarshorav11 it's not pretty, but what I do is monitor for the process to come up first (whatever needs to wait)/. This is an example only. httpd.conf
/opt/supervisor/httpd_supervisor:
|
Another team with this problem, we need to start a apps only after dnsmasq correctly started, if not the app will resolve and cache the wrong DNS So there is already the https://github.com/jasoncorbett/ordered-startup-supervisord, why this is not merged in the main supervisor, is there any reason for this not to be fixed? edit: another similar fork https://github.com/bendikro/supervisord-dependent-startup |
Any elegant solution? |
i'm all for this feature |
It has been fun tracking this issue for all these years, but I finally unsubscribed 😂 |
My case is that I just want to control the stopping order when manually not in supervisord control period, |
+1 |
1 similar comment
+1 |
all these years of tracking just means that supervisor is an outdated relict and it is time to start using something better. it was good for its time though |
Without implementing full dependencies, a simple option for e.g.
Extra credit: Use an integer property to specify the max # of seconds to wait. e.g.
Some programs take a few minutes to start ... This idea was inspired by this Stack Overflow answer. |
For my use cases I need this feature and I implemented a depends_on parameter which takes care that processes are only spawned once all dependees are in RUNNING and if not they are scheduled and will be spawned as soon as possible. All processes will be spawned in the expected order. |
@michaelhammann After more than 9 years, you seem like the Messiah to bring redemption to us mere mortals. I am not exaggerating. Thanks! |
I needed to start a bunch of independent processes sequentially to avoid overloading underlying services. I've ended up wrapping each process in a bash script that does locking and start synchronisation. Not ideal but does the job. In the
The
|
Wow, after almost 10 years no solution? I had this issue when forking an 'old' repository where supervisord was being used. It had a sleep after the first command, but that didn't work. My solution was: [supervisord]
nodaemon = true
[program:influxdb]
priority = 1
command = bash -c "/etc/init.d/influxdb start && sleep 5"
autostart=true
autorestart=true
[program:telegraf]
priority = 2
command = bash -c "sleep 15 && /etc/init.d/telegraf start"
autostart=true
autorestart=true
[program:grafana]
priority = 3
command = bash -c "sleep 30 && /etc/init.d/grafana-server start"
autostart=true
autorestart=true So all 3 are spawned at the same time, but telegraf and grafana won't actually start after a few seconds. This seems to work fine here for a few days. Only when showing ps -ef | grep grafana (or telegraf) will show a process with sleep in it, but I can live with that. Tried with startsecs=... and waitforstartseconds=.. but that didn't work with this docker container, or at least not in all test-cases, so I reverted back to the mentioned method with the sleep before starting the service. |
I just found https://github.com/davmac314/dinit which can run as a system init or a user process supervisor. It looks simpler than supervisor and supports dependencies properly. You guys might want to check out dinit. I also looked into runit and s6. s6 is clunky as a user process supervisor. Runit doesn't support dependencies. OpenRC doesn't support being run as a user process supervisor. Systemd is no good for this, either. |
@amano-kenji s6 is not bad if you'd like to spend a bit of time understanding how it works, it is really flexible in what it can do. If the goal is to plug something in and it works without any configuration, s6 is definitely a poor choice. |
The dealbreaker was s6-rc which cannot be used if s6 is not PID 1. dinit is simple. |
My config:
My output =>
What I expected to happen =>
redis would start and supervisord would wait 30 seconds before starting any lower priority processes.
The text was updated successfully, but these errors were encountered: