states.supervisord restart option should not exist
The restart option in the supervisord state always restarts the given program group.
This feels completely wrong. This isn't a state. If it were it would be called 'restarted', not 'running'. It's a command, and modules.supervisord.restart already exists to do this.
If the state of the program group is being managed by salt e.g the virtualenv, pkg, etc... then a watch should be used.
If the state of the supervisor program group is being managed outside of salt states then it should be restarted outside of salt states.
I agree that I don't think I would use it in states. However, someone obviously thought it would be useful, as they added it in. So I don't think we want to just remove it, as that could break backwards compatibility.
I would say just ignore it. =)
Is it safe to ignore? I expect it would interfere with prereqs at least.
However, someone obviously thought it would be useful
mod_watch wasn't originally implemented for this state - I added it a while back. Now that watches work I think this should be at least documented as bad practice.
Yes, if you don't define that argument, then it defaults to False, which is the behavior you want, right?
As far as mod_watch goes, we could definite label it as deprecated and instruct people to use watch instead.
Works for me - hopefully it can be removed eventually.
@basepi can we make this a docfix, add some documentation highlighting that the module function is preffered to use of this particular state, and then perhaps this function could be flagged for depreciated down the line?
Updated the labels.
Checked the docs and restart is no longer there, closing.
have just wasted 2 hours or so bumping the wall with my head on this :))
Someone (I actually know who) wrote a "supervisord.running" state and included "restart=False" as an option. Thus "watch" actually did nothing, because it has "restart=True" ONLY if the state itself has not "restart" in options. And specifying "restart=True" ALWAYS restarts a service !
In retrospect, it sort of seems logical, but still... :) was very annoying experience