summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-07-14 18:43:14 +0000
committerBill Nottingham <notting@redhat.com>2005-07-14 18:43:14 +0000
commit16f87092094ef42566725cafd59ca08171f8d9b0 (patch)
treecabad31e0f7739e90787a630d41f4c56bf9f6cf3
parentca872d169e41e92a984eb0f56d32303b9b3f9258 (diff)
downloadinitscripts-16f87092094ef42566725cafd59ca08171f8d9b0.tar.gz
initscripts-16f87092094ef42566725cafd59ca08171f8d9b0.tar.xz
initscripts-16f87092094ef42566725cafd59ca08171f8d9b0.zip
handle lvm & fsck for network block devices (#148764, <alewis@redhat.com>)
-rw-r--r--initscripts.spec1
-rwxr-xr-xrc.d/init.d/netfs54
2 files changed, 54 insertions, 1 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 8c0a9d91..3c6e6372 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -218,6 +218,7 @@ rm -rf $RPM_BUILD_ROOT
- add proper ipsec route (#146169, #140654)
- fix grep mismatching interfaces (#157252, #153669)
- handle alternate vlan naming schemes (#115001)
+- netfs: handle lvm & fsck for network block devices (#148764, <alewis@redhat.com>)
* Wed Apr 20 2005 Bill Nottingham <notting@redhat.com> 7.93.13.EL-2
- check number of siblings on AMD64 processors as well (#155331)
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs
index b64c06b6..c1769d9d 100755
--- a/rc.d/init.d/netfs
+++ b/rc.d/init.d/netfs
@@ -3,6 +3,7 @@
# netfs Mount network filesystems.
#
# Authors: Bill Nottingham <notting@redhat.com>
+# AJ Lewis <alewis@redhat.com>
# Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#
# chkconfig: 345 25 75
@@ -23,11 +24,13 @@ NFSFSTAB=`LC_ALL=C awk '!/^#/ && $3 ~ /^nfs/ && $3 != "nfsd" && $4 !~ /noauto/ {
SMBFSTAB=`LC_ALL=C awk '!/^#/ && $3 == "smbfs" && $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`
-NETDEVMTAB=`LC_ALL=C awk '!/^#/ && $4 ~ /_netdev/ && $2 != "/" { print $2 }' /etc/mtab`
+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`
SMBMTAB=`LC_ALL=C awk '!/^#/ && $3 == "smbfs" { 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`
+NETDEVMTAB=`LC_ALL=C awk '!/^#/ && $4 ~ /_netdev/ && $2 != "/" { print $2 }' /etc/mtab`
# See how we were called.
case "$1" in
@@ -40,6 +43,47 @@ case "$1" in
[ -n "$SMBFSTAB" ] && action $"Mounting SMB filesystems: " mount -a -t smbfs
[ -n "$CIFSFSTAB" ] && action $"Mounting CIFS filesystems: " mount -a -t cifs
[ -n "$NCPFSTAB" ] && action $"Mounting NCP filesystems: " mount -a -t ncpfs
+ [ -n "$NETDEVFSTAB" ] &&
+ {
+ if [ -x /sbin/lvm.static ]; then
+ if /sbin/lvm.static vgscan > /dev/null 1>&1 ; then
+ action $"Setting up Logical Volume Management:" /sbin/lvm.static vgchange -a y
+ fi
+ fi
+ STRING=$"Checking network-attached filesystems"
+
+ echo $STRING
+ fsck -A -T -R -a -t opts=_netdev
+ rc=$?
+
+ if [ "$rc" -eq "0" ]; then
+ success "$STRING"
+ echo
+ elif [ "$rc" -eq "1" ]; then
+ passed "$STRING"
+ echo
+ fi
+
+ if [ "$rc" -gt 1 ]; then
+ if [ -x /usr/bin/rhgb-client ] && /usr/bin/rhgb-client --ping ; then
+ /usr/bin/rhgb-client --details=yes >/dev/null 2>&1
+ fi
+
+ failure "$STRING"
+ echo
+ echo
+ echo $"*** An error occurred during the file system check."
+ echo $"*** Dropping you to a shell; the system will reboot"
+ echo $"*** when you leave the shell."
+
+ str=$"(Repair filesystem)"
+ PS1="$str \# # "; export PS1
+ [ "$SELINUX" = "1" ] && disable_selinux
+ sulogin
+
+ shutdown -r now
+ fi
+ }
touch /var/lock/subsys/netfs
action $"Mounting other filesystems: " mount -a -t nonfs,nfs4,smbfs,cifs,ncpfs,gfs
;;
@@ -133,6 +177,10 @@ case "$1" in
echo $"Configured NCP mountpoints: "
for fs in $NCPFSTAB; do echo $fs ; done
}
+ [ -n "$NETDEVFSTAB" ] && {
+ echo $"Configured network block devices: "
+ for fs in $NETDEVFSTAB; do echo $fs ; done
+ }
[ -n "$NFSMTAB" ] && {
echo $"Active NFS mountpoints: "
for fs in $NFSMTAB; do echo $fs ; done
@@ -149,6 +197,10 @@ case "$1" in
echo $"Active NCP mountpoints: "
for fs in $NCPMTAB; do echo $fs ; done
}
+ [ -n "$NETDEVMTAB" ] && {
+ echo $"Active network block devices: "
+ for fs in $NETDEVMTAB; do echo $fs ; done
+ }
else
echo $"/proc filesystem unavailable"
fi