/etc/init.d/go-agent stop stops the agent using pid from PID_FILE#5897
Merged
marques-work merged 3 commits intogocd:masterfrom Feb 26, 2019
Merged
/etc/init.d/go-agent stop stops the agent using pid from PID_FILE#5897marques-work merged 3 commits intogocd:masterfrom
marques-work merged 3 commits intogocd:masterfrom
Conversation
ketan
reviewed
Feb 23, 2019
|
|
||
| if [ $? -eq 0 ]; then | ||
| killproc -p $PID_FILE /usr/share/${SERVICE_NAME}/agent.sh >/dev/null | ||
| killproc |
Member
There was a problem hiding this comment.
Would you not pass an executable to killproc? Am I missing something?
Member
There was a problem hiding this comment.
killproc is not the standard one. It's just a function in this file.
stop-agent.sh knows how to find the pid, and uses kill to stop the process
Contributor
Author
marques-work
requested changes
Feb 25, 2019
* Directly calling stop-agent.sh instead of wrapping in psuedo-killproc fn
marques-work
approved these changes
Feb 26, 2019
Member
|
Edit: I've made this change in d317486. Can someone see if that's allright?
|
ketan
added a commit
that referenced
this pull request
Feb 27, 2019
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see #5858 for details on the issue this addresses
I would have ideally used
pkill -u go -F $PID_FILEbut pkill on centos 6 does not have a supported way to use the pid file to stop a process. This approach should ideally work on all of the linux distros we support.I'm also unsure why we were passing arguments we weren't using to
killprocThis line is the one I'm referring to here