Properly run restartComponent.sh avoiding hardwired paths #12185
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #12184
Status
ready
Description
With the current change we avoid hardwired paths inside the
restartComponent.sh
script, and instead we properly tie those as relative paths to the proper environment$WMA_*
variables.In addition we add the executable flag to the script and change its shell from
sh
tobash
, in order to be correctly run and later quit in case of errors from the cronjobs of the agents, instead of being sourced and the errors silently ignored if the script just quits (exit $errCode
inside a sourced script will just close the shell sourcing the script leaving no trace of the error code returned).Is it backward compatible (if not, which system it affects?)
YES
Related PRs
This PR goes hand in hand with: dmwm/CMSKubernetes#1569
External dependencies / deployment changes
The WMAgent packages uploaded to Pypi.
Since the
restartComponent.sh
script is always run by our cronjobs from$WMA_DEPLOY_DIR/deploy/
it will always be the version of the script coming from the WMAgent pypi package which is to be executed, regardless if one runs the service from source or from the pypi packages. So even if the fix is applied and patched the change won't take effect until the newly built python package is redeployed at the destination or eventually the script substituted manually.