Skip to content

Commit

Permalink
Modify the logic for when the memory params are changed
Browse files Browse the repository at this point in the history
The current exec for changing the memory params will run unless the
ending condition is met. However, the command itself is dependant upon a
particular start condition. This leads to a loop where if the MEM_ARGS
don't match the 'unless', it will run the exec and the exec won't change
anything because sed isn't able to match anything (though it completes
successfully).

This PR will fix that by changing the 'unless' to an 'onlyif', and
making the condition of that 'onlyif' the same as the search string that
sed is looking for in the exec
  • Loading branch information
Michael Power committed Aug 16, 2018
1 parent 802036b commit 7a4b4bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/bsu.pp
Expand Up @@ -89,7 +89,7 @@

exec { "change memory params for ${patch_file}":
command => "sed -e's/MEM_ARGS=\"-Xms256m -Xmx512m\"/MEM_ARGS=\"-Xms256m -Xmx1024m -XX:-UseGCOverheadLimit\"/g' ${middleware_home_dir}/utils/bsu/bsu.sh > ${download_dir}/bsu.sh && mv ${download_dir}/bsu.sh ${middleware_home_dir}/utils/bsu/bsu.sh;chmod +x ${middleware_home_dir}/utils/bsu/bsu.sh",
unless => "grep 'MEM_ARGS=\"-Xms256m -Xmx1024m -XX:-UseGCOverheadLimit\"' ${middleware_home_dir}/utils/bsu/bsu.sh",
onlyif => "grep 'MEM_ARGS=\"-Xms256m -Xmx512m\"' ${middleware_home_dir}/utils/bsu/bsu.sh",
before => Bsu_patch["${middleware_home_dir}:${patch_id}"],
path => $exec_path,
user => $os_user,
Expand Down

0 comments on commit 7a4b4bf

Please sign in to comment.