-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
service.running: failure to start with enable: True reports no changes / no errors #5894
Comments
Thanks, I'll try to reproduce. What distro/version are you running? We have multiple service backends, so it might be an issue with the backend rather than the state itself. |
Actually, this doesn't look like a bug at all. Did you actually experience this problem, or is this report just from looking at the code? If you look at line 295 in this block, the changes = {name: __salt__['service.start'](name)}
if not changes[name]:
ret['result'] = False
ret['comment'] = 'Service {0} failed to start'.format(name)
if enable is True:
ret = _enable(name, False, **kwargs)
ret['result'] = False
elif enable is False:
return _disable(name, False, **kwargs)
else:
return ret |
If anything, it looks like there might be an issue with the return data if enable is False. |
I did experience it. If I'm reading correctly, if the service fails to start and enable is True, it doesn't actually return in this block. Instead, it flows on to here: if enable is True:
return _enable(name, True, **kwargs) |
If the service fails to start, then |
Ahh I see what is going on here. There is no return after the result is set to False. |
Yes, so it continues on and runs _enable a second time, and returns the result of that. |
The _enable and _disable functions need to be smarter about how they set the result value. I'll audit them and make sure they're returning the proper info, this should take care of the issue. Thanks for the report. |
@mgwilliams Did your pull request resolve this issue? Can it be closed? |
@basepi Yes, it did. Thanks! |
Using latest git code (0.17.x), I'm having a somewhat similar issue - a failure to start a service is not correctly reported back to the master as such. Here's the output from a manual call on the minion shell:
And the output on the master:
The state is basic:
I'm on Debian 7 (Wheezy). |
@ruimarinho Could you create a new issue? I'm guessing it's a slightly different bug. |
Of course, will do. Thanks for the feedback. |
I believe there is a bug in service.running.
If a service fails to start, but enable: is provided, it returns only the status of service._enable and fails to return the failure to start.
The text was updated successfully, but these errors were encountered: