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 #16128: We should not start agent daemons outside of the service #261

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions share/commands/server-disable-policy-distribution
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
# First, prevent the agent from restarting cf-serverd
touch /opt/rudder/etc/disable-policy-distribution

# Then, actually stop the server right now
# Then disable and stop it
systemctl stop rudder-cf-serverd
systemctl disable rudder-cf-serverd

# Just in case other cf-server were running
if type killall > /dev/null 2> /dev/null; then
killall cf-serverd
killall cf-serverd 2> /den/null || true
elif type pidof > /dev/null 2> /dev/null; then
kill $(pidof cf-serverd 2>/dev/null)
kill $(pidof cf-serverd 2>/dev/null) 2> /dev/null || true
else
echo "Don't know how to stop Rudder policy server. 'killall' or 'pidof' are required." 1>&2
echo 'Policy server not stopped!' 1>&2
exit 2
echo "Could not check for remaining policy server processes outside of the service"
echo "(install 'pidof' or 'killall' to enable this check)"
fi
3 changes: 2 additions & 1 deletion share/commands/server-enable-policy-distribution
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
rm -f /opt/rudder/etc/disable-policy-distribution

# Then, actually start the server right now
/var/rudder/cfengine-community/bin/cf-serverd
systemctl enable rudder-cf-serverd
systemctl start rudder-cf-serverd