Setting up an HP SIM server 6.0 or greater on a Linux-based Serviceguard Cluster White Paper 444847-004, February 2010

31
echo ${LV[@]} | tr ' ' '
\
012' | sed
-
e 's/^/ /'
# Perform parallel fsck's for better performance.
# Limit the number of concurrent fsck to
CONCURREN
T_FSCK_OPERATIONS
R=0
while (( R < ${#LV[*]} ))
do
j=0
while (( j < CONCURRENT_FSCK_OPERATIONS && R <
${#LV[*]} ))
do
(
case ${FS_TYPE[$R]} in
ext2|ext3) e2fsck ${FS_FSCK_OPT[$R]}
-
y ${LV[$R]}
# on linux fsck will return a 1 if filesystem
errors
# were corrected. This means that the filesystem was
# dirty but is now clean so we should be able to
# con
tinue. Any other errors we should abort as normal.
if (( $? > 1 ))
then
# this will set $? to 1
let 0
test_return 2
fi
;;
reiserfs)fsck
-
a ${FS_TYPE_ARG[$
R]}
${FS_FSCK_OPT[$R]} ${LV[$R]}
if (( $? > 1 ))
then
# this will set $? to 1
let 0
test_return 2
fi
;;
nfs) : # do nothing for nfs
;;
*)fsck
-
p
-
T ${FS_TYPE_ARG[$R]} ${LV[$R]}
if (( $? > 1 ))
then
# this will set $? to 1
let 0
test_return 2
fi
;;
esac
) &
# save the process id for monit
oring the status
pids_list[$j]="$!"
(( j = j + 1 ))
(( R = R + 1 ))
done
# wait for background fsck's to finish
while (( j > 0 ))
do
pid=${pids_list[$j
-
1]}
wait $pid
if (( $? != 0 ))
then