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 #14833: Use rudder agent check at postinst and factory reset to avoid duplacing code #215

Conversation

peckpeck
Copy link
Member

@peckpeck peckpeck commented May 7, 2019

rudder agent reset
fi
echo " Done"
[ "$QUIET" = false ] && printf "INFO: Promises absent restoring initial version, and updating ..."
Copy link
Member

Choose a reason for hiding this comment

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

"Policies absent, restoring"...

fi
if ! ${CFE_DIR}/bin/cf-promises -f failsafe.cf > /dev/null || ! ${CFE_DIR}/bin/cf-promises > /dev/null
then
[ "$QUIET" = false ] && printf "${YELLOW}WARNING${NORMAL}: Promises invalid, reseting to initial promises and updating..."
Copy link
Member

Choose a reason for hiding this comment

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

Promises -> Policies

@peckpeck
Copy link
Member Author

peckpeck commented May 9, 2019

Commit modified

@@ -113,9 +127,9 @@ check_and_fix_cfengine_processes() {
CF_EXECD_RUNNING=`${PS_COMMAND} | grep "${CFE_DIR}/bin/cf-execd" | sed -e '/grep/d' | cat`
NB_CF_EXECD_RUNNING=`echo "${CF_EXECD_RUNNING}" | sed -e '/^$/d' | wc -l`
if [ ${NB_CF_EXECD_RUNNING} -gt 1 ]; then
printf "WARNING: Too many instance of CFEngine cf-execd processes running. Killing them..."
[ "$QUIET" = false ] && printf "${YELLOW}WARNING${NORMAL}: Too many instance of CFEngine cf-execd processes running. Killing them..."
Copy link
Member

Choose a reason for hiding this comment

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

CFEngine cf-execd -> Rudder cf-execd

fi

# Check for anomalous number of CFEngine processes
# If there are more than 6 agent/executor processes, we should kill them, and purge the lock database
# 6 means 1 cf-execd + 5 cf-agent
if [ "${NB_CF_PROCESS_RUNNING}" -gt 6 ]; then
printf "WARNING: Too many instance of CFEngine processes running. Killing them, and purging the CFEngine lock database..."
[ "$QUIET" = false ] && printf "${YELLOW}WARNING${NORMAL}: Too many instance of CFEngine processes running. Killing them, and purging the CFEngine lock database..."
Copy link
Member

Choose a reason for hiding this comment

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

CFEngine processes -> Agent processes

Copy link
Member

Choose a reason for hiding this comment

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

CFengine lock -> agent lock

echo "********************************************************************************"
echo "rudder-agent has been installed (not started). This host can be a Rudder node."
echo "To get started, configure your Rudder server's hostname and continue the process:"
echo "# echo 'rudder.server' > ${CFE_DIR}/policy_server.dat"
Copy link
Member

Choose a reason for hiding this comment

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

we should display /opt/rudder/etc instead here

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 think this is the lase place that should be changed since if the symlink was not created this will fail

@peckpeck
Copy link
Member Author

peckpeck commented May 9, 2019

Commit modified

@Normation-Quality-Assistant

OK, squash merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant force-pushed the arch_14833/use_rudder_agent_check_at_postinst_and_factory_reset_to_avoid_duplacing_code branch from a9ce466 to 517e0a6 Compare May 9, 2019 09:33
@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 517e0a6 into Normation:master May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants