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

Init fix #94

Merged
merged 2 commits into from
Aug 26, 2016
Merged

Init fix #94

merged 2 commits into from
Aug 26, 2016

Conversation

igalic
Copy link
Contributor

@igalic igalic commented Aug 15, 2016

currently our system-v init file's status() has flawed logic.
This pr tries to address that.

it also makes stop() more robust

the if logic needed reversing.
checks for stale pid files now
@igalic
Copy link
Contributor Author

igalic commented Aug 15, 2016

we really need monads in bash…
and a better different vector for returning status and success, or… etc…

@bastelfreak
Copy link
Member

@igalic can you take a look at #96 please?

@fessyfoo
Copy link
Contributor

actually check #95 but I think it's a less comprehensive version of this.

@@ -107,13 +113,13 @@ stop() {
}

status() {
if [ ! -f "$PID_FILE" ]; then
if ! [ -f "$PID_FILE" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I don't think this matters. [ is equiv to the builtin test and from the posix description of test:

! expression
True if expression is false. False if expression is true.

$ [ -f /doesnotexist ] && echo true || echo false
false
$ [ ! -f /doesnotexist ] && echo true || echo false 
true

I'm curious if you just did this for style purposes, habit, or some other need that I'm missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a mix of the above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to me, if ! [ denotes unless [, whereas if [ ! denotes: ATTENTION: YOU HAVE TO THINK ABOUT LOGIC NOW

@fessyfoo
Copy link
Contributor

FWIW I recommend merging this. without it the service is broken, and puppet will continually try to restart the service thinking it's down.

@fessyfoo
Copy link
Contributor

turns out I'm a committer on this project. why are the checks failing? ok, fixed that.

@igalic
Copy link
Contributor Author

igalic commented Aug 31, 2016

@fessyfoo would you like to become a committer on all @voxpupuli projects?

elmendalerenda pushed a commit to elmendalerenda/puppet-kafka that referenced this pull request Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants