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
Fixes #8808: Use rudder agent commands when possible in postinst #1003
Fixes #8808: Use rudder agent commands when possible in postinst #1003
Conversation
This PR contains the commit from #8807 (PR #1002) too. |
# Set a "lock" to avoid CFEngine being restarted during the upgrade process | ||
I_SET_THE_LOCK=0 | ||
if [ ! -f /opt/rudder/etc/disable-agent ]; then | ||
I_SET_THE_LOCK=1 | ||
touch /opt/rudder/etc/disable-agent | ||
${RUDDER_CMD}/agent-disable |
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.
Why are you calling the commands directly in /opt/rudder/share/commands rather than via their wrapper (/opt/rudder/bin/rudder)?
I think this could backfire on us one day, since that wrapper could very well add some sanity checks, or other features, and the individual commands may not function standalone.
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.
I'm doing this because the rudder command may not be in the path
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.
Right, but we can use the full path to avoid that. Don't you think there's a risk?
Aside from that, this looks great! |
It contains another commit because it depends on it. |
Commit modified |
032f078
to
9fd7bf4
Compare
AGENT_STOP_CMD="$2" | ||
AGENT_START_CMD="$3" | ||
CFE_DIR="/var/rudder/cfengine-community" | ||
RUDDER_CMD="/opt/rudder/bin rudder" |
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.
This should be /opt/rudder/bin/rudder (you used a space instead of a slash)
Commit modified |
9fd7bf4
to
b4fa2b6
Compare
This needs rebasing |
PR rebased |
b4fa2b6
to
9b6a212
Compare
OK, merging this PR |
https://www.rudder-project.org/redmine/issues/8808