Marco Agostini
2011-Jul-11 12:04 UTC
[Gluster-users] bash exit code when mount command failed
Hy, when a mount command fail (for some reason, server unavailable, volume not exists....) the system don't show any error message. I know that I can find the error on client-side in /var/log/glusterfs/*.log I'm using glusterfs 3.2.1 and glusterd 3.2.1 These is the command that I'm using on client-side: # mount -t glusterfs serveroff:/notexistvolume /mnt (the server not exist and the volume not exist !) # echo $? when I digit "echo $?" I'm expect that the command return NOT 0 (zero). I want using mount command in an external script bash and test if the mount command are executed correctly. I't possiple without "parse" the content of /var/log/glusterfs ? thanks.
Darren Austin
2011-Jul-11 12:09 UTC
[Gluster-users] bash exit code when mount command failed
----- Original Message -----> Hy, when a mount command fail (for some reason, server unavailable, > volume not exists....) the system don't show any error message. > > # mount -t glusterfs serveroff:/notexistvolume /mnt (the server not > exist and the volume not exist !) > # echo $? > > when I digit "echo $?" I'm expect that the command return NOT 0 > (zero). I want using mount command in an external script bash and test > if the mount command are executed correctly.I had noticed the same thing, and intended to post a note about it too :) The way I worked around this issue is to use the "mountpoint" command directly after the mount. Eg: mount -t glusterfs server:volume /mnt mountpoint /mnt echo $? ... will do what you want :) HTH, Darren. -- Darren Austin - Systems Administrator, Widgit Software. Tel: +44 (0)1926 333680. Web: http://www.widgit.com/ 26 Queen Street, Cubbington, Warwickshire, CV32 7NA.