We are mounting a Windows shared drive on Redhat Enterprise Edition (Kernel 2.6). The command: mount -t smbfs -o username=bongo;password=bingo;workgroup=TANGO //WindowsPC/SharedName$ /mnt/win-shared-drives/pc001 happily mounts the Windows shared on the specified mount point.
Hence, we moved this command to rc.local, so that mounting would be automatically be done when the server is recycled (rc.local is the script that Redhat executes last in its boot sequence after it configures and runs network services, mounts file systems, starts various daemons and all the remaining chores...). Hence, we appended this line to rc.local and restarted the server. To our surprise, we found a strange message on boot console: No Route to Host.
Baffled by this output, we ping the box checked the arp, but ping echoed back with success and arp showed the IP in its listing. But again, No Route to Host means we have no network connectivity at boot-time and after the init was complete, we had the network connectivity. So we decided to put in a quick hack in rc.local, by performing a ping for some cycles and then grepping the output of arp to check for the server IP entry...and finally that worked. Here is the snippet of that code:
MAXTRIES=10 count="0" while [ "$count" -lt MAXTRIES ] do ping -c 5 SERVERNAME if arp | grep SERVERNAME then break fi count=$[$count+1] done
mount -t smbfs -o username=bongo;password=bingo;workgroup=TANGO //SERVERNAME/SharedName$ /mnt/win-shared-drives/pc001
I am still thinking about a solution that is cleaner than the above approach. If you come across a solution please leave let me know. Thanks!
____________________________________________________________________________________ Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html