From 6c600b53db1e35158fa671af2ed1f9d7187fc902 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Wed, 30 Apr 2014 15:10:17 +0200 Subject: netfs: implicitly handle glusterfs as a network filesystemd --- rc.d/init.d/netfs | 13 +++++++++++++ rc.d/rc.sysinit | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 4bcbe022..26b8e351 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -22,11 +22,13 @@ NFSFSTAB=$(LC_ALL=C awk '!/^#/ && $3 ~ /^nfs/ && $3 != "nfsd" && $4 !~ /noauto/ { print $2 }' /etc/fstab) CIFSFSTAB=$(LC_ALL=C awk '!/^#/ && $3 == "cifs" && $4 !~ /noauto/ { print $2 }' /etc/fstab) NCPFSTAB=$(LC_ALL=C awk '!/^#/ && $3 == "ncpfs" && $4 !~ /noauto/ { print $2 }' /etc/fstab) +GLUSTERFSFSTAB=$(LC_ALL=C awk '!/^#/ && $3 == "glusterfs" && $4 !~ /noauto/ { print $2 }' /etc/fstab) NETDEVFSTAB=$(LC_ALL=C awk '!/^#/ && $4 ~/_netdev/ && $4 !~ /noauto/ { print $1 }' /etc/fstab) NFSMTAB=$(LC_ALL=C awk '$3 ~ /^nfs/ && $3 != "nfsd" && $2 != "/" { print $2 }' /proc/mounts) CIFSMTAB=$(LC_ALL=C awk '$3 == "cifs" { print $2 }' /proc/mounts) NCPMTAB=$(LC_ALL=C awk '$3 == "ncpfs" { print $2 }' /proc/mounts) +GLUSTERFSMTAB=$(LC_ALL=C awk '$3 == "fuse.glusterfs" { print $2 }' /proc/mounts) NETDEVMTAB=$(LC_ALL=C awk '$4 ~ /_netdev/ && $2 != "/" { print $2 }' /etc/mtab) # See how we were called. @@ -41,6 +43,7 @@ case "$1" in } [ -n "$CIFSFSTAB" ] && echo $"CIFS filesystems queued to be mounted" [ -n "$NCPFSTAB" ] && echo $"NCP filesystems queued to be mounted" + [ -n "$GLUSTERFSFSTAB" ] && echo $"GLUSTERFS filesystems queued to be mounted" [ -n "$NETDEVFSTAB" ] && { if [ -f /etc/mdadm.conf ] && [ -x /sbin/mdadm ]; then @@ -111,6 +114,12 @@ case "$1" in $"Unmounting network block filesystems: " \ $"Unmounting network block filesystems (retry): " fi + if [ -n "$GLUSTERFSMTAB" ]; then + __umount_loop '$3 ~ /^glusterfs/ {print $2}' \ + /etc/mtab \ + $"Unmounting GLUSTERFS filesystems: " \ + $"Unmounting GLUSTERFS filesystems (retry): " + fi if [ -n "$NFSMTAB" ]; then __umount_loop '$3 ~ /^nfs/ && $3 != "nfsd" && $2 != "/" {print $2}' \ /proc/mounts \ @@ -152,6 +161,10 @@ case "$1" in echo $"Active NCP mountpoints: " for fs in $NCPMTAB; do echo $fs ; done } + [ -n "$GLUSTERFSMTAB" ] && { + echo $"Active GLUSTERFS mountpoints: " + for fs in $GLUSTERFSMTAB; do echo $fs ; done + } [ -n "$NETDEVMTAB" ] && { echo $"Active network block devices: " for fs in $NETDEVMTAB; do echo $fs ; done diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 2f4be943..81984d9a 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -509,9 +509,9 @@ fi # filesystems are NOT unmounted in single user mode. # The 'no' applies to all listed filesystem types. See mount(8). if [ "$READONLY" != "yes" ] ; then - action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev + action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2,glusterfs -O no_netdev else - action $"Mounting local filesystems: " mount -a -n -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev + action $"Mounting local filesystems: " mount -a -n -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2i,glusterfs -O no_netdev fi # Update quotas if necessary -- cgit v1.2.1