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

chef-client stop init.d service stopping other process fixes #717

Merged

Conversation

antima-gupta
Copy link
Contributor

@antima-gupta antima-gupta commented Oct 29, 2020

Signed-off-by: antima-gupta agupta@msystechnologies.com

Description

  • Fixed stop init.d service stopping other process issue.

Issues Resolved

#221
#718

Check List

Signed-off-by: antima-gupta <agupta@msystechnologies.com>
Signed-off-by: antima-gupta <agupta@msystechnologies.com>
@@ -43,6 +43,8 @@ start() {

stop() {
echo -n $"Stopping $prog: "
# It will pick the process id directly from the running process and adding into $pidfile.
ps -ef |grep $exec |grep -v grep |awk '{print $2}' > $pidfile
Copy link
Contributor

@tas50 tas50 Oct 29, 2020

Choose a reason for hiding this comment

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

Has this been tested to confirm this works? -p is for a pidfile. Does it work if you stick a PID in there instead of a path?

Copy link
Contributor Author

@antima-gupta antima-gupta Oct 30, 2020

Choose a reason for hiding this comment

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

@tas50 Yes it has been tested working fine. It won't work if we stick PID in there because killproc does not having that type of functionality. In killproc function there are mentioned that if you are mentioning -p then you have to give pidfile not pid.

@tas50 tas50 merged commit fd92505 into chef-boneyard:master Oct 30, 2020
@tas50
Copy link
Contributor

tas50 commented Oct 30, 2020

This seems like it really kills the whole point of the assigned pidfile, but I guess that's the kind of thing we have to do for RHEL 6 which thankfully is EOL at the end of this month. This whole fix doesn't live for long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants