Comment 9 for bug 933575

Revision history for this message
borninbronx (daniele-segato) wrote :

Hi Steve,

I'm really sorry, that server has been took out from production a while ago, and I completely forgotten about this.

last week we had some disk space issue in our multi-porpouse virtual machine manager and I get rid of old unused VMs, the one with this issue was one of them: it's gone.

I kept the workaround I used there and I report it here, it may be helpful to someone...
It's a script that start at boot time (as cron) and retry every 5 seconds to mount fstab disks until it's successfull.

I created this script in /usr/sbin/nfs-boot-mount

#!/bin/sh

LOG_DIR="/var/log/nfs-boot-mount";
LOG_FILE="${LOG_DIR}/nfs-boot-mount_`date +'%Y_%m_%d'`.log";
RETRY_IN_SEC=5;

checkAndMount() {
 echo "`date` - Try mounting nfs..." >> "${LOG_FILE}"
 mount -a >> "${LOG_FILE}" 2>&1;
 result=$?;
 if [ $result -eq 0 ] ; then
  echo "SUCCESS!" >> "${LOG_FILE}"
 else
  echo "FAILED! Retrying in ${RETRY_IN_SEC} seconds." >> "${LOG_FILE}"
 fi
 return $result;
}

loopCheckMount() {
 fail=1;
 while [ $fail -ne 0 ] ; do
  sleep ${RETRY_IN_SEC};
  checkAndMount;
  fail=$?;
 done;
}

mkdir -p "${LOG_DIR}";

checkAndMount
if [ $? -ne 0 ] ; then
 loopCheckMount &
fi

# END

gave it +x (execution permission)

then:
crontab -e

and add:
@reboot /usr/sbin/nfs-boot-mount-check

this will start the script at boot time and retry mount -a until it's successful, everything will be logged in /var/log/nfs-boot-mount/ directory.

I apologize again, I really forgot it.