Distribution: Fedora 44
Kernel: 7
DM: Mate-compiz
Since upgrade to Fedora 44 and 610 Cuda, when used in a bash script and self extraction package executed in subshell, the installer open an Xterm terminal and execute itself inside.
If tmpdir specified in option, it stat it as an unknown option then send term signal.
I didn’t succeed to have a full verbose output, but the following test script reproduce the issue as the original script do.
#!/bin/bash
# cuda self extraction package open an xterm terminal when used
# in a subshell command.
# The numbered test fncs are for reproduce the script pipe.
# xterm cuda exposed window title: NVIDIA CUDA PACKAGE
# script include --tmp_dir Cuda installer error.
set -eu
export PS4='->$(tput setaf 6)${LINENO}$(tput sgr 0)$(printf "\\t")-> '
declare exec_dir=/mnt/data_tmp # package directory
declare tmp_dir=temp # temp test dir directory
declare toolkit=cuda_13.3.0_610.43.02_linux.run
trap_on_exit(){ # Optional
# syntax : trap_on_exit "cmd+ops" "argument"/"var=data"
local CMD="${1}" ; shift
local -a args=()
for a in "${@}"; do
args+=("$(printf '%q' "$a")")
done
if ((${#args[@]})); then # same as [[ -n $var ]] and (( ${#args[@]} > 0 ))
command_to_trap+=( "${CMD} ${args[*]}" )
else
command_to_trap+=( "${CMD}" )
fi
local IFS=';'
local trap_line="${command_to_trap[*]}"
eval "trap '$trap_line' EXIT"
}
tmp_dir(){ # minimalist tmpdir fnc from real script
buildtmp=$exec_dir/$tmp_dir/build
extc_tmp=$exec_dir/$tmp_dir/tmp
mkdir -p $extc_tmp $buildtmp
trap_on_exit 'rm -Rf' "$extc_tmp" "$buildtmp"
}
win_yad_progress(){ # original script real yad window fnc # could be parltly faulty
# syntax :
# with pulse : { timeout=xx ;{ [script] ;}& eval lpid=$!; y_pulse; } | win_yad_progress
# progress : { [script] } | win_yad_progress
# y_text="[string]"
# pulse=0/1 #> do pulse or not
# log=0/1 #> display log window or not
# hold=0/1 #> Hold window or not
# hide_txt=0/1 #> Hide progress bar txt or not
# extra options : hold options need other strings and depend of base script predefine option.
# >> echo -e $esc_message" (without '' arround text var) inside script string shell '{...}'
# ex : with hold >> pulse=1; log=1; hold=1 ; hide_txt=1
# autoclose with no progress bar text >> pulse=1; log=1; hold=0 ; hide_txt=1
# autoclose with progres bar text >> pulse=1; log=0; hold=0 ; hide_txt=0
local height='' autoclose do_pulse nobutton log_hid='' log_en='' log_ex='' log_h=''
local img_zen_desktop=gtk-warning
if [ $log = 1 ]; then
log_hid='--hide-text'; log_en='--enable-log='; log_ex='--log-expanded'; log_h='--log-height=300'; height='--height=300' #; log_hold=${x_hold}
fi
autoclose="--auto-close"; nobutton="--no-button"
[ $hide_txt = 1 ] && hide_txt='--hide-text' || hide_txt=''
[ $pulse = 1 ] && do_pulse='--pulsate' || do_pulse=''
#--css="$(yad_css)"
( yad --width=600 $height --window-icon=$img_zen_desktop --title="$WIN_TITLE" --center \
--progress $do_pulse $nobutton $autoclose $hide_txt --borders=15 --text="$y_text" \
${log_hid} ${log_en} ${log_ex} ${log_h} )
_exit=$?
if [ $_exit -eq 1 ]; then echo 1;
elif [ $_exit -eq 252 ]; then echo 2 ;
else echo 0; fi
return
}
y_pulse(){
[ -f $buildtmp/y_pid ] && local lpid=$(cat $buildtmp/y_pid) || true
while [ -d /proc/$lpid ]; do
for ((i=1; i<=$timeout; i++)) {
echo $i 2>/dev/null
sleep 0.096
}
done
return
}
fn_4(){
echo -e "# Step 5"; sleep 1
local PATH=${exec_dir}:$PATH # cuda self extraction package can execute without a clear localized path definition
# ${toolkit} --silent --toolkit --override --tmpdir=$exec_dir/$tmp_dir
# faster test with same xterm popup
${toolkit} --extract=$extc_tmp --tmpdir=$buildtmp
}
fn_3(){
echo -e "# Step 4"; sleep 1
}
fn_2(){
echo -e "# Step 2"; sleep 1
y_text=$"NVIDIA CUDA update check"
local pulse=1 log=1 hold=0 hide_txt=0
# local IFS=' ' # TEST
{ local timeout=30; {
echo -e "# Step 3"; sleep 1
fn_4
} & eval lpid=$! ; y_pulse; } | win_yad_progress # the "&" isolating the subshell is the issue that open xterm
}
fn_1(){
echo -e "# Step 1"; sleep 1
fn_2
}
WIN_TITLE=test
tmp_dir
echo -e "# Step 0"; sleep 1
pushd $exec_dir
fn_1
popd