salt icon indicating copy to clipboard operation
salt copied to clipboard

states.supervisord restart option should not exist

Open olliewalsh opened this issue 13 years ago • 8 comments

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.

olliewalsh avatar Jul 17 '13 23:07 olliewalsh

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. =)

basepi avatar Jul 18 '13 01:07 basepi

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.

olliewalsh avatar Jul 18 '13 22:07 olliewalsh

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.

basepi avatar Jul 18 '13 22:07 basepi

Works for me - hopefully it can be removed eventually.

olliewalsh avatar Jul 18 '13 22:07 olliewalsh

@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?

techdragon avatar Feb 17 '14 14:02 techdragon

Updated the labels.

basepi avatar Feb 19 '14 18:02 basepi

Checked the docs and restart is no longer there, closing.

jacobhammons avatar Oct 07 '15 12:10 jacobhammons

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

62mkv avatar Nov 28 '16 11:11 62mkv