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

[core] Normalize exit code of fallback status command #1988

Merged
merged 1 commit into from
Oct 21, 2015

Conversation

olivielpeau
Copy link
Member

The exit code of the status command has to be one of 0, 1, 2, 3, 4,
69 to be correctly understood by Ansible, but was returning 253
when the agent was not running on linux kernel versions 3.18+

Normalize the exit code to 0 or 1 to avoid the issue.

See https://github.com/ansible/ansible-modules-core/blob/cbbb20b6bf0d82fdc92f064c9e4d18c04f203da6/system/service.py#L590

Fixes #1976

More generally we could try to stick more closely to the LSB specs for the exit code of the status command.

The exit code of the `status` command has to be one of 0, 1, 2, 3, 4,
69 to be correctly understood by Ansible, but was returning `253`
when the agent was not running on linux kernel versions 3.18+

Normalize the exit code to 0 or 1 to avoid the issue.

See https://github.com/ansible/ansible-modules-core/blob/cbbb20b6bf0d82fdc92f064c9e4d18c04f203da6/system/service.py#L590

Fixes #1976
@remh
Copy link

remh commented Oct 21, 2015

👍

remh pushed a commit that referenced this pull request Oct 21, 2015
…us-code

[core] Normalize exit code of fallback `status` command
@remh remh merged commit 2bbbd76 into master Oct 21, 2015
@olivielpeau olivielpeau deleted the olivielpeau/normalize-init-status-code branch October 22, 2015 18:20
@olivielpeau olivielpeau modified the milestones: 5.6.0, 5.5.2 Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.18 kernel detection breaks ansible service hooks
2 participants