Skip to content

Commit

Permalink
Refs #3925 - Fix wrong files and bizarre logics
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Perron committed Sep 19, 2013
1 parent 1c7847b commit 1f27955
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions rudder-agent/SPECS/rudder-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,14 @@ fi

# Add temporary cron for checking UUID. This cron is created in postinst
# in order to remove it later without complains of the package manager.
CHECK_RUDDER_AGENT_CRON=`grep "check-rudder-agent" techniques/system/common/1.0/rudder_agent_community_cron.st | wc -l`
CHECK_RUDDER_AGENT_CRON=`grep "/opt/rudder/bin/check-rudder-agent" /etc/cron.d/rudder-agent | wc -l`
# Add it only if the default cron file does not call check-rudder-agent script
if [ ${CHECK_RUDDER_AGENT_CRON} -ne 1 ]; then
echo "0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /opt/rudder/bin/check-rudder-agent" > /etc/cron.d/rudder-agent-uuid
chmod 755 /etc/cron.d/rudder-uuid
if [ ${CHECK_RUDDER_AGENT_CRON} -eq 0 ]; then
TMP_CRON=/etc/cron.d/rudder-agent-uuid
if [ ! -f ${TMP_CRON} ]; then
echo "0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /opt/rudder/bin/check-rudder-agent" > ${TMP_CRON}
chmod 755 ${TMP_CRON}
fi
fi

%preun -n rudder-agent
Expand Down
11 changes: 7 additions & 4 deletions rudder-agent/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@ case "$1" in

# Add temporary cron for checking UUID. This cron is created in postinst
# in order to remove it later without complains of the package manager.
CHECK_RUDDER_AGENT_CRON=`grep "check-rudder-agent" techniques/system/common/1.0/rudder_agent_community_cron.st | wc -l`
CHECK_RUDDER_AGENT_CRON=`grep "/opt/rudder/bin/check-rudder-agent" /etc/cron.d/rudder-agent | wc -l`
# Add it only if the default cron file does not call check-rudder-agent script
if [ ${CHECK_RUDDER_AGENT_CRON} -ne 1 ]; then
echo "0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /opt/rudder/bin/check-rudder-agent" > /etc/cron.d/rudder-agent-uuid
chmod 755 /etc/cron.d/rudder-uuid
if [ ${CHECK_RUDDER_AGENT_CRON} -eq 0 ]; then
TMP_CRON=/etc/cron.d/rudder-agent-uuid
if [ ! -f ${TMP_CRON} ]; then
echo "0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /opt/rudder/bin/check-rudder-agent" > ${TMP_CRON}
chmod 755 ${TMP_CRON}
fi
fi
;;

Expand Down

0 comments on commit 1f27955

Please sign in to comment.