Skip to content

Commit

Permalink
added for debugging pivot_root error
Browse files Browse the repository at this point in the history
  • Loading branch information
namrathaurs committed May 21, 2024
1 parent c81d55a commit d50f10b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion creation/lib/cgWDictFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def refresh_file_list(dicts, is_main, files_set_readonly=True, files_reset_chang
# dictionaries must have been written to disk before using this
def refresh_signature(dicts): # update in place
signature_dict = dicts["signature"]
for k in ("consts", "vars", "untar_cfg", "gridmap") + cgWConsts.FILE_LISTS_PRIORITIES + ("description"):
for k in ("consts", "vars", "untar_cfg", "gridmap") + cgWConsts.FILE_LISTS_PRIORITIES + ("description",):
if k in dicts:
signature_dict.add_from_file(dicts[k].get_filepath(), allow_overwrite=True)
# add signatures of all the files linked in the lists
Expand Down
4 changes: 4 additions & 0 deletions creation/web_base/cvmfs_helper_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ mount_cvmfs_repos () {
if [[ $cvmfsexec_mode -eq 1 ]]; then
"$glidein_cvmfsexec_dir/$dist_file" "$config_repository" -- echo "setting up mount utilities..." &> /dev/null
fi
loginfo "MYDEBUG (mount_cvmfs_repos): CVMFSMOUNT = $CVMFSMOUNT"
loginfo "Mounting CVMFS config repo now..."
[[ $cvmfsexec_mode -eq 1 ]] && "$glidein_cvmfsexec_dir"/.cvmfsexec/mountrepo "$config_repository"
[[ $cvmfsexec_mode -eq 3 || $cvmfsexec_mode -eq 2 ]] && $CVMFSMOUNT "$config_repository"
Expand All @@ -271,12 +272,15 @@ mount_cvmfs_repos () {
# using an array to unpack the names of additional CVMFS repositories
# from the colon-delimited string
repos=($(echo $additional_repos | tr ":" "\n"))
loginfo "MYDEBUG (mount_cvmfs_repos): CVMFSMOUNT = $CVMFSMOUNT"
loginfo "Mounting additional CVMFS repositories..."
# mount every repository in the array
for repo in "${repos[@]}"
do
[[ $cvmfsexec_mode -eq 1 ]] && "$glidein_cvmfsexec_dir"/.cvmfsexec/mountrepo "$repo"
loginfo "MYDEBUG (mount_cvmfs_repos): before mounting cvmfs repos"
[[ $cvmfsexec_mode -eq 3 || $cvmfsexec_mode -eq 2 ]] && $CVMFSMOUNT "$repo"
loginfo "MYDEBUG (mount_cvmfs_repos): after mounting cvmfs repos"
done
# verify if all the repositories got mounted
if [[ $cvmfsexec_mode -eq 3 || $cvmfsexec_mode -eq 2 ]]; then
Expand Down
7 changes: 5 additions & 2 deletions creation/web_base/cvmfs_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ is_cvmfs_locally_mounted() {
}

################################## main #################################

set -x
# first parameter passed to this script will always be the glidein configuration file (glidein_config)
glidein_config=$1

Expand Down Expand Up @@ -115,10 +115,12 @@ if [[ $? -eq 0 ]]; then
export GLIDEIN_WORKSPACE=$original_workspace
export GWMS_CVMFS_REEXEC=$gwms_cvmfs_reexec
export GWMS_CVMFSEXEC_MODE=$cvmfsexec_mode
export GLIDEIN_WORK_DIR="$work_dir"
export GWMS_GLIDEIN_WORK_DIR="$work_dir"
loginfo "MYDEBUG (cvmfs_setup.sh): (in mode 3 logic) GWMS_GLIDEIN_WORK_DIR = $GWMS_GLIDEIN_WORK_DIR"
export GLIDEIN_CVMFS_CONFIG_REPO="$GLIDEIN_CVMFS_CONFIG_REPO"
export GLIDEIN_CVMFS_REPOS="$GLIDEIN_CVMFS_REPOS"
echo "Reinvoking glidein now..."
echo "MYDEBUG: PATH (before glidein reinvocation): $PATH"
exec "$glidein_cvmfsexec_dir"/"$dist_file" -- "$GWMS_STARTUP_SCRIPT"
echo "!!WARNING!! Outside of reinvocation of glidein_startup"
# the above line of code should not run; but is here as a safety check for debugging incorrect behavior of exec from previous line
Expand Down Expand Up @@ -157,3 +159,4 @@ else
"$error_gen" -ok "$(basename $0)" "mnt_msg14" "Non-RHEL OS found but not supported; continuing without CVMFS setup"
return 0
fi
set +x
14 changes: 9 additions & 5 deletions creation/web_base/glidein_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ printenv GWMS_CVMFS_REEXEC > /dev/null
status=$?
if [[ "$status" -eq 0 ]]; then
# glidein being reinvoked
echo "MYDEBUG (glidein_startup.sh): PATH = $PATH"
gwms_cvmfs_reexec=$(printenv GWMS_CVMFS_REEXEC | sed s"/ //g")
else
# regular glidein invocation
echo "MYDEBUG (glidein_startup.sh): PATH = $PATH"
gwms_cvmfs_reexec=$(grep "^GWMS_CVMFS_REEXEC " "${glidein_config}" | cut -d ' ' -f 2-)
fi
# Customizable and initialization variables
Expand All @@ -26,9 +28,11 @@ IFS=$' \t\n'
# Some sites empty PATH. Setting a reasonable default
if [[ -z "$PATH" ]]; then
export PATH="/bin:/usr/bin"
elif [[ -z "$gwms_cvmfs_reexec" ]]; then
export PATH="/usr/sbin:$PATH"
fi
# if [[ -z "$gwms_cvmfs_reexec" ]]; then
# echo "MYDEBUG (glidein_startup.sh): going into elif"
# export PATH="/usr/sbin:$PATH"
# fi

global_args="$*"
# GWMS_STARTUP_SCRIPT=$0
Expand Down Expand Up @@ -1676,7 +1680,7 @@ else
fi
fi
work_dir_created=1
export GWMS_GLIDEIN_WORK_DIR=${GLIDEIN_WORK_DIR} # for glidein reinvocation
export GWMS_GLIDEIN_WORK_DIR=${work_dir} # for glidein reinvocation

# GWMS_SUBDIR defined on top
GWMS_DIR="${work_dir}/$GWMS_SUBDIR"
Expand Down Expand Up @@ -2045,9 +2049,11 @@ if [[ -n "$gwms_cvmfs_reexec" && "$gwms_cvmfs_reexec" == "yes" ]]; then
status=$?
if [[ ${status} -eq 0 ]]; then
work_dir=$(printenv GWMS_GLIDEIN_WORK_DIR | sed "s/ //g")
echo "MyDebug: after glidein reinvocation: (in mode 3) work_dir = $work_dir"
glidein_config=$(printenv GWMS_GLIDEIN_CONFIG | sed "s/ //g")
repository_url=$(printenv GWMS_REPOSITORY_URL | sed "s/ //g")
main_dir=$(printenv GWMS_MAIN_DIR | sed "s/ //g")
echo "MyDebug: after glidein reinvocation: (in mode 3) main_dir = $main_dir"
last_script=$(printenv GWMS_LAST_SCRIPT | sed "s/ //g")
check_signature=$(printenv GWMS_CHECK_SIGNATURE | sed "s/ //g")
startup_time=$(printenv GWMS_STARTUP_TIME | sed "s/ //g")
Expand All @@ -2068,8 +2074,6 @@ if [[ -n "$gwms_cvmfs_reexec" && "$gwms_cvmfs_reexec" == "yes" ]]; then
# re-sourcing the helper script inside of cvmfsexec environment
. "$work_dir"/cvmfs_helper_funcs.sh
mount_cvmfs_repos $gwms_cvmfsexec_mode $cvmfs_config_repo $cvmfs_add_repos
# check if the cvmfs repos are still mounted inside of reinvocation
df -h

# re-source all the scripts as it'd have been done during the first invocation of this script
extract_all_data
Expand Down
1 change: 1 addition & 0 deletions doc/factory/custom_vars.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ <h3>Custom HTCondor Variables</h3>
<li><a href="#admin_vars">Admin variables</a></li>
<li><a href="#dyn_vars">Dynamic variables </a></li>
<li><a href="#singularity_vars">Singularity variables </a></li>
<li><a href="#cvmfs_vars">CVMFS variables </a></li>
<li>
<a href="#cpuscalculation">Set and discover available CPUs</a>
</li>
Expand Down

0 comments on commit d50f10b

Please sign in to comment.