Skip to content
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

How to make changes persist after restarting supervisord? #4

Closed
saulp opened this issue Mar 5, 2015 · 2 comments
Closed

How to make changes persist after restarting supervisord? #4

saulp opened this issue Mar 5, 2015 · 2 comments

Comments

@saulp
Copy link

saulp commented Mar 5, 2015

Hi! I am working on a project that requires starting processes on the fly, and this plugin seems to very nicely fit the bill. I would just like the new processes that I start to be persistent.

What is a recommended way to do this, short of adding to my script the capability to modify the supervisord.conf file itself? (in which case it would probably be simpler to just skip twiddler altogether, and restart supervisord after modifying my config file... but I digress)

Thanks!
Saul

@natsu90
Copy link

natsu90 commented Oct 29, 2015

In Ajenti, it has a plugin; a GUI to manage Supervisord, including add & delete program, https://github.com/ajenti/ajenti/tree/1.x/ajenti/plugins/supervisor. I wish I can understand python.

@mnaberez
Copy link
Owner

I actually wrote supervisor_twiddler at a time before Supervisor had the ability to reread its config file. I think the main use case for supervisor_twiddler today is for temporary changes that you don't want to persist.

If you want to make changes to the Supervisor and have them persist, I think the best way to do that is to modify or add config files, then use the supervisorctl's config reloading commands:

  • reread: Reread the config file to make supervisord aware of changes, but don't apply any changes. This outputs the difference between the on-disk configuration and in-memory configuration like foo: added or bar: removed.
  • add: Add a new program to supervisord's in-memory configuration.
  • remove: Remove a program from supervisord's in-memory configuration.
  • update: Update changes to a program or use update all for the magic "update everything".

You might use this in combination with the [include] section, which lets you include extra config files. You can keep these in a directory like /etc/supervisor/conf.d, your program can add or remove files from that directory, then use update all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants