aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-07-14 18:43:35 +0000
committerBill Nottingham <notting@redhat.com>2005-07-14 18:43:35 +0000
commita075664cce63ad954e903ec143275f58c58efe2c (patch)
tree1b2200310d57c8bcafd94c49ec2c5d037763eb26
parent39c5934861a018502da17ac285984e80db7d7583 (diff)
downloadinitscripts-a075664cce63ad954e903ec143275f58c58efe2c.tar
initscripts-a075664cce63ad954e903ec143275f58c58efe2c.tar.gz
initscripts-a075664cce63ad954e903ec143275f58c58efe2c.tar.bz2
initscripts-a075664cce63ad954e903ec143275f58c58efe2c.tar.xz
initscripts-a075664cce63ad954e903ec143275f58c58efe2c.zip
handle lvm & fsck for network block devices (#148764, <alewis@redhat.com>)r7-31-24-EL
-rw-r--r--initscripts.spec1
-rwxr-xr-xrc.d/init.d/netfs51
2 files changed, 51 insertions, 1 deletions
diff --git a/initscripts.spec b/initscripts.spec
index f3d7551a..fb96079c 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -256,6 +256,7 @@ rm -rf $RPM_BUILD_ROOT
#114548, <link@pobox.com>)
- mkkerneldoth: fix for newer sed (#159159, <trevin@xmission.com>)
- fix grep mismatching interfaces (#157252, #153669)
+- handle lvm & fsck for network block devices (#148764, <alewis@redhat.com>)
* Wed Apr 20 2005 Bill Nottingham <notting@redhat.com>
- 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 4e6d0b71..de7b23a6 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
@@ -22,10 +23,12 @@
NFSFSTAB=`LC_ALL=C awk '!/^#/ && $3 == "nfs" && $4 !~ /noauto/ { print $2 }' /etc/fstab`
SMBFSTAB=`LC_ALL=C awk '!/^#/ && $3 == "smbfs" && $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" && $2 != "/" { print $2 }' /proc/mounts`
SMBMTAB=`LC_ALL=C awk '!/^#/ && $3 == "smbfs" { 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
@@ -37,6 +40,44 @@ case "$1" in
}
[ -n "$SMBFSTAB" ] && action $"Mounting SMB filesystems: " mount -a -t smbfs
[ -n "$NCPFSTAB" ] && action $"Mounting NCP filesystems: " mount -a -t ncpfs
+ [ -n "$NETDEVFSTAB" ] &&
+ {
+ if [ -e /proc/lvm -a -x /sbin/vgchange ]; then
+ action $"Setting up Logical Volume Management:" /sbin/vgscan && /sbin/vgchange -a y
+ 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
+ sulogin
+
+ shutdown -r now
+ fi
+ }
touch /var/lock/subsys/netfs
action $"Mounting other filesystems: " mount -a -t nonfs,smbfs,ncpfs,gfs
;;
@@ -125,6 +166,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
@@ -137,6 +182,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