Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Merge "Change for switching between NFSv3 and NFSv4 on cloud_controller"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Peckham authored and Gerrit Code Review committed Sep 4, 2012
2 parents 053118a + ac4f885 commit 0b6f948
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions jobs/cloud_controller/templates/cloud_controller_ctl.erb
Expand Up @@ -70,16 +70,25 @@ case $1 in
/etc/init.d/idmapd restart

if grep -qs $NFS_SHARE /proc/mounts; then
echo "Found NFS mount"
else
echo "Mounting NFS..."
mount -o timeo=10,intr,lookupcache=positive -t nfs4 <%= properties.nfs_server.address %>:<%= properties.nfs_server.share || "/" %> $NFS_SHARE
if [ $? != 0 ]; then
echo "Cannot mount NFS, exiting..."
echo "Found NFS mount, unmounting..."
umount $NFS_SHARE
if [ $? -ne 0 ]; then
echo "Failed to unmount NFS, exiting..."
exit 1
fi
fi

echo "Mounting NFS..."
<% if properties.nfs_server.nfsv4 %>
mount -o timeo=10,intr,lookupcache=positive -t nfs4 <%= properties.nfs_server.address %>:<%= properties.nfs_server.share || "/" %> $NFS_SHARE
<% else %>
mount -o timeo=10,intr,lookupcache=positive -t nfs <%= properties.nfs_server.address %>:<%= properties.nfs_server.share || "/var/vcap/store/shared" %> $NFS_SHARE
<% end %>
if [ $? != 0 ]; then
echo "Cannot mount NFS, exiting..."
exit 1
fi

chpst -u vcap:vcap touch $NFS_SHARE/.nfs_test

if [ $? != 0 ]; then
Expand Down

0 comments on commit 0b6f948

Please sign in to comment.