Skip to content

Commit b8a0ec1

Browse files
committed
BF: CS-2370 upgrade procedure logs "touch: cannot touch '/tmp/cs_2026-06-26_16:01:30/centry.tmp': Permission denied"
1 parent 428f756 commit b8a0ec1

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

source/dist/inst_sge

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,21 @@ if [ "$UPDATE" = true ]; then
388388
cloned_backup_directory=`CloneDir ${UPGRADE_BACKUP_DIR} ${current_date}`
389389
UPGRADE_BACKUP_DIR=$cloned_backup_directory
390390

391+
# CloneDir ran before we knew the cluster's admin_user (ADMINUSER is
392+
# still "default" at this point), so /tmp/cs_<date>/ is root-owned with
393+
# 755 perms. Later, after GetAdminUser, ExecuteAsAdmin routes through
394+
# adminrun and tries to touch/cp inside the clone as the admin user —
395+
# which fails with "Permission denied" (CS-2370). Read admin_user from
396+
# the cloned backup's bootstrap and chown the tree so subsequent
397+
# admin-user operations on the clone work.
398+
if [ "`id -u`" = "0" ]; then
399+
_bup_admin_user=`BootstrapGetValue "${UPGRADE_BACKUP_DIR}/cell" admin_user`
400+
if [ -n "$_bup_admin_user" ] && [ "$_bup_admin_user" != "none" ]; then
401+
chown -R "$_bup_admin_user" "$UPGRADE_BACKUP_DIR"
402+
fi
403+
unset _bup_admin_user
404+
fi
405+
391406
# Read sge_root, sge_cell, qmaster, execd port from the backup
392407
SGE_ROOT=`pwd | sed 's/\/tmp_mnt//'`
393408
bck_sge_root=`cat "${UPGRADE_BACKUP_DIR}/sge_root" | awk -F= '{print $2}' | awk -F\; '{print $1}' 2>/dev/null`

source/dist/util/install_modules/inst_common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,7 @@ MoveLog()
27392739
loghosttype="execd"
27402740
fi
27412741

2742-
if [ $EXECD = "uninstall" -o $QMASTER = "uninstall" -o $SHADOW = "uninstall" ]; then
2742+
if [ "$EXECD" = "uninstall" -o "$QMASTER" = "uninstall" -o "$SHADOW" = "uninstall" ]; then
27432743
installtype="uninstall"
27442744
else
27452745
installtype="install"

source/dist/util/upgrade_modules/upgrade_config.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ PRODUCT_SHORTCUT="sge"
3636

3737
HOST=$("$ROOTDIR"/utilbin/"$ARCH"/gethostname -aname)
3838

39+
# arch_variables defines Translate (used by ExecuteAsAdmin's error path);
40+
# without it any failure inside ExecuteAsAdmin would log "Translate: not
41+
# found" instead of the intended message (CS-2370).
42+
. "$ROOTDIR"/util/arch_variables
3943
. "$ROOTDIR"/util/install_modules/inst_common.sh
4044
BasicSettings
45+
# Switch $INFOTEXT from the bare "echo" set by BasicSettings to the real
46+
# infotext binary; otherwise option flags like "-log" are printed literally
47+
# and "%s" format placeholders are never expanded (CS-2370).
48+
SetUpInfoText
4149
GetAdminUser
4250

4351
###############################################################################

0 commit comments

Comments
 (0)