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

Fixes #8808: Use rudder agent commands when possible in postinst #1003

Conversation

peckpeck
Copy link
Member

@peckpeck peckpeck commented Aug 3, 2016

@jooooooon
Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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?

@jooooooon
Copy link
Member

Aside from that, this looks great!

@peckpeck
Copy link
Member Author

peckpeck commented Aug 4, 2016

It contains another commit because it depends on it.

@peckpeck
Copy link
Member Author

peckpeck commented Aug 4, 2016

Commit modified
Use 'rudder' command and replace it in cron

@peckpeck peckpeck force-pushed the arch_8808/use_rudder_agent_commands_when_possible_in_postinst branch from 032f078 to 9fd7bf4 Compare August 4, 2016 09:44
AGENT_STOP_CMD="$2"
AGENT_START_CMD="$3"
CFE_DIR="/var/rudder/cfengine-community"
RUDDER_CMD="/opt/rudder/bin rudder"
Copy link
Member

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)

@peckpeck
Copy link
Member Author

peckpeck commented Aug 4, 2016

Commit modified

@peckpeck peckpeck force-pushed the arch_8808/use_rudder_agent_commands_when_possible_in_postinst branch from 9fd7bf4 to b4fa2b6 Compare August 4, 2016 13:54
@jooooooon
Copy link
Member

This needs rebasing

@peckpeck
Copy link
Member Author

peckpeck commented Aug 4, 2016

PR rebased

@peckpeck peckpeck force-pushed the arch_8808/use_rudder_agent_commands_when_possible_in_postinst branch from b4fa2b6 to 9b6a212 Compare August 4, 2016 14:48
@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 9b6a212 into Normation:master Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants