-
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
New Feature: disable
/enable
#591
Comments
Yes, please!!! |
👍 |
2 similar comments
👍 |
👍 |
When I first posted this, I was told by one of the package maintainers (in a private email, or comment since deleted?):
With my knowledge of Supervisor, I thought I could patch this into the core distro – but I have no idea how to do this as a plugin. I tried, and it didn't seem doable with the available hooks. |
I know the possibility to disable services from Solaris' SMF. It feels pretty wird that supervisor does not have something similar. |
The crusty workaround I've been using is managing servers with two directories:
The actual config files are in services-all, they are symlinked into services-enabled which is what supervisord reads. This is the same approach to how some os distros package apache and nginx. The shortcoming is that you have to disable the process in supervisor AND on the disk; then enable the process in both places as well -- otherwise the service will start up on a reboot. It's really confusing, but it works. |
@jvanasco not a direct fix, but you should give Ansible a try. Works very well once you invest a little bit of time to write proper playbooks. |
+1 |
+200 |
Anything new on this front? |
+1 as well! |
This can be easily implemented with the help of symlinks, in the same way http servers are doing like apache and nginx. Please just create such folder structure to support the feature. |
@varunpalekar no, this can't be easily implemented with symlinks like apache/nginx (which I also covered above as a bad interim solution, and many people already do) Apache and Nginx are entirely controlled by the presence of files in the include directories. If a file is in "/sites-enabled", then it is enabled on application setup. There is no in-process system to change that -- in order to start/stop a configured host, one would edit or symlink a file and then restart the service. Supervisorctl is a process supervisor. Placing a configuration file in "/sites-enabled" or "/sites-available" makes the service available for Supervisor -- but Supervisor also has in-process controls that handle that service being started or stopped... and a configuration may or may not "autostart" a service. Supervisor itself wouldn't be able to use symlinks, because the process configurations could be inline within a single file -- meaning a feature like that would not work on many configurations in-the-wild. Supervisorctl simply needs to persist into a small datafile (pickle, json, whatever) the name of "stopped" items, so they are not auto-started if the system reboots. I think the best place to do this might be in a secondary config file called |
@jvanasco I just suggest a simple tweak through which you can gain what you need. You can achieve your goal by just following point:
You can also make above script parameterized and move to any Above process is just a tweak, it will help in your scenario. If you want it in supervisor itself PR requests are welcome. |
@varunpalekar Please read the entire thread, as everything you say has been addressed.
|
+1 |
@varunpalekar |
The lack of this feature has brought me to look for a new process manager. This has happened twice in the past week:
Now either I've:
The amount of extra coding and administration needed to support this lack of a basic feature is substantial. We're migrating off. |
👍 |
🙏🏻 |
+1 |
@varunpalekar , seems a good workaround for now. But I believe that a "disable" and "enable" options, are still the best, since that it is something that is well-know for managing services, since SysV script managers like "chkconfig" and "update-rc.d". I understand that the purpose of Supervisor is a little bit different (better than SysV concept), but in fact, it gets easier to manage Supervisor services. +1 Thanks for all the keep Supervisor. You rock :)! |
+1 |
Another +1 from me. Any progress on this matter? |
+1 Quite bizarre supervisor doesn't have this feature. |
+1 |
+1 i really need such a feature |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 Really needed this today. Sadly there is no such feature |
+1 |
2 similar comments
+1 |
+1 |
I was just reading the docs, looking for this feature. Default: adding |
@dlangille Not sure where you read that, but i can't see any mention of that behaviour in the docs. Also: +1 |
I don't know. I don't recall posting this, but I do recall reading this issue. I should have posted a link. Closest I could find now was autostart. |
+1 |
The simplest solution is actually to stop the supervisord service. Consider this bad? Supervisor should implement a disable/enable per-process option. As a workaround it obviously doesn't respect any processes you might want to keep running, but it involves zero hacks and tends to meet my 'maintenance mode' needs and is very clean. Your mileage may vary. |
+1 |
I need this feature as well. As a workaround, I'm doing like this: Rename the .conf file to be something like .conf.disable and then update it.
|
Would also like this. Thanks for the mentioned workaround @praditha-hidayat! |
+1 |
+1 |
Wow, such basic and essential functionality is still not implemented. Unbelievable. |
This function is available in the version 0.13 of the Supvisors plugin:
When disabled, all the processes linked to the program are stopped. Trying to start a disabled process will raise a RPCError with a The current disabled status is made available through the web UI (state in grey) or using:
|
Well, what you got to say now? |
I still would say "why does supervisor core not have this"? 😉 |
If you set |
This actually works. When set to |
I'd like to suggest a new feature: disable/enable a program.
disabled
flag on the disk. "disabled" processes will not be considered for "all" commands or on restart.disabled
flag on the disk.Rationale:
I often have to "disable" a process during maintenance, for fear that the system could restart and supervisord would restart the process. In order to do this, I have to essentially unregister the service by editing the supervisord config files. Even if using symlinks in a directory, this is awkward and tedious -- and I lose the program's status from within supervisor. Trying to find out if something is "disabled" is a chore, because I have to match a list of available configurations with active ones.
I think a better solution would be to simply mark the status as "disabled" and persist that to disk. The program would still be registered to supervisord and ready to
enable
at any time. The supervisorctl app andstatus
command would clearly report that the configuration is "disabled".I looked through the source and this seems relatively easy to do -- except for persisting the data to disk. I can't figure out a good place to store this.
If the maintainers think this is an acceptable idea and can suggest a place/mechanism for storing data, I think I can fork and PR.
The text was updated successfully, but these errors were encountered: