Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] NFS client difference between Solaris and Linux



I work with a number of Linux systems (Fedora 12) and Solaris systems (8 and 10).  I want to be able to monitor the status of NFS mounts - sometimes systems are taken down while another system is actively using an NFS export from that system.

While writing a script to monitor the health of the NFS mounts on a system, I discovered that the following shell constructs work differently in Linux and Solaris 10 (haven't looked at Solaris 8 yet):

csh:
if ( -d /home/foo ) echo foo
if ( -e /home/foo ) echo foo
if ( ! -d /home/foo ) echo no foo
if ( ! -e /home/foo ) echo no foo


sh/bash:
[ -d /home/foo ] && echo foo
[ -d /home/foo ] || echo no foo

On Linux, the commands will cause the system to attempt to make the NFS mount, and return the status of that mount.  If the server is offline, the mount attempt does not hang.

On Solaris, the commands will check to see if /home/foo is defined in /etc/auto_home and return the status of that lookup.  No mount is attempted, so that 

/home is defined the same on both systems:
/home   /etc/auto.home	-nobrowse,retry=3,suid

If I use this test:
[ -f /home/foo/. ]  || echo foo

Linux continues to work as before.  Solaris does actually attempt the mounts, but if the server is offline, the mount attempt hangs.




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org