Debian 8.2용 Siemens NX 10 애플리케이션을 설치하는 스크립트를 디버깅했는데 다음과 같은 경고가 표시되었습니다.
/usr/ugs100이 포함된 파일 시스템을 확인할 수 없습니다.
공간 계산이 잘못되었을 수 있습니다.
스크립트 소스 코드:ug_설치(너무 커서 여기에 게시할 수 없습니다.) 호출하는 두 함수 및 기타 관련 함수와 함께 이 메시지를 생성하는 코드 조각은 다음과 같습니다.
Init_fs_arrays() # Initializes the File System array.
{ # RKB Thu Jan 31 22:39:57 PST 1991
# RKB Updated: Sep 28 15:26:28 PDT 1992
# RKB updtd: Jul 6 22:51 93 V10.1.1 make generic.
# RKB updtd: Mar 7 18:34 94 V103P2E streamline, rm "set --".
# RKB updtd: Mar 9 22:34 94 V103P2E rm test -s for FS_FILE, just wait f
# RKB updtd: Wed Apr 20 2005 NX4P11 Added Linux support.
# This function initializes the FS_NAME & FS_FREE
# arrays based on the contents of $FS_FILE
FS_FILE="$UGS_TMP/filesystem_info" # File name to read the results from.
$VECHO "${MSG}Initializing File System array ..."
wait $SIZE_FS_PID # in case the file is not ready, wait for the bg job.
I=0 # Initialize the index
# Linux
# cat $FS_FILE | while read NAME SPACE ; do
# Linux cant do "cat file | while read" "must use while read done < file
while read NAME SPACE ; do
FS_NAME[$I]=$NAME ; FS_FREE[$I]=${SPACE:=0} ; FS_NEEDED[$I]=0
((I+=1)) # Increment the index.
done < $FS_FILE
return 0
} # End of Init_fs_arrays
Get_fsindex() # Get the index number to supplied file system name.
{ # RKB Mon Jan 21 21:00 91
# RKB Mar 8 23:59 94 V103P2E chg to use while loop not grep -n. faster.
: ${FS_NAME[*]:?} # Required variable internal check.
: ${1:?} # Required arg internal check.
I=0 # Init the index counter
# Loop thru the FS_NAME array to get index number for filesystem in arg
while [ $I -le ${#FS_NAME[*]} ] ; do
[ $1 = "${FS_NAME[$I]}" ] && { echo $I ; return 0; }
((I+=1)) # Increment the index.
done
unset FS_INDEX ;
return 1 # Didn't find the file system.
} # End of Get_fsindex
Get_fs_info() # Returns filesystem info for the directory argument.
{
# Requires 2 global variables.
: ${DF_CMD:?cmd var must be set to use this function. }
: ${AWK_CMD:?cmd var must be set to use this function. }
# Requires 2 args; a switch and a target directory.
TARGET=$2 ; : ${TARGET:?} # Internal check
#
# If dir doesn't exist, check parent.
while [ ! -d $TARGET ] ; do
[ -f $TARGET ] && { # error if a file exists.
print "${ERR}directory name expected. file exists: $TARGET" >&2
return 1 ;
}
TARGET=`dirname $TARGET`
done
#
# Do appropriate action based on the switch. The options are:
# use -sp to get free space, -fs for real filesystem name, -mnt returns
# the mount point and -nfs returns true if the filesystem is NFS mounted,
# and false if it's not.
#
# Set machine specific number for the df field containing filesystem.
[ $MACHINE = IRIX -o $MACHINE = IRIX64 ] && N=6 || N=5
case $1 in
-fs*) $DF_CMD $TARGET | tr "\012" " " | $AWK_CMD '{print $(NF-$N)}' ;;
-mnt*) $DF_CMD $TARGET | tr "\012" " " | $AWK_CMD '{print $NF}' ;;
-nfs) $DF_CMD $TARGET | tr "\012" " " | $AWK_CMD '{print $(NF-$N)}' | grep ":/" >$NULL || return 1 ;;
-sp*) $DF_CMD $TARGET | tail -1 | $AWK_CMD '{printf("%d",$(NF-2))}' ;;
esac
return 0
} # Get_fs_info
…
SPACE_REQUIRED_KB=0
# Get the mount point for BASE_DIR.
BASE_MNT_PT=`Get_fs_info -mnt $BASE_DIR` || {
print "${WARN}Could not determine mount point for $BASE_DIR
\r\tFile System information may be incorrect.
} # Shouldn't be any problem, but just to be safe.
FS_INDEX=`Get_fsindex $BASE_MNT_PT` || {
print "${WARN}Could not determine filesystem containing $BASE_DI
\r\tspace calculations may be incorrect. "
} # Shouldn't be any problem, but just to be safe.
#
임시 파일 내용 /tmp/filesystem_info
:
/dev 10240
/run 1621732
/dev/shm 4031816
/run/lock 5116
/dev/mqueue 0
/dev/hugepages 0
/boot/efi 72815
/run/user/116 815520
/run/user/1000 815484
- 함수
Get_fs_info
가 반환됩니까? filesystem_info
파일의 내용을 이해하는 방법은 무엇입니까 ?