-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Init fix #94
Conversation
the if logic needed reversing.
checks for stale pid files now
we really need monads in bash… |
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
FWIW I recommend merging this. without it the service is broken, and puppet will continually try to restart the service thinking it's down. |
turns out I'm a committer on this project. why are the checks failing? ok, fixed that. |
@fessyfoo would you like to become a committer on all @voxpupuli projects? |
currently our system-v init file's
status()
has flawed logic.This pr tries to address that.
it also makes
stop()
more robust