aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-07-14 18:42:47 +0000
committerBill Nottingham <notting@redhat.com>2005-07-14 18:42:47 +0000
commit101a552aac7da98cff4288655694e81bdedca4df (patch)
treeb127867b76b0779f1598f38ad8f2464a4a2da6f5 /rc.d/init.d
parent13c44cf2c8ddb59096a8e0bed7ea05ae264f1cae (diff)
downloadinitscripts-101a552aac7da98cff4288655694e81bdedca4df.tar
initscripts-101a552aac7da98cff4288655694e81bdedca4df.tar.gz
initscripts-101a552aac7da98cff4288655694e81bdedca4df.tar.bz2
initscripts-101a552aac7da98cff4288655694e81bdedca4df.tar.xz
initscripts-101a552aac7da98cff4288655694e81bdedca4df.zip
handle lvm & fsck for network block devices (#148764, <alewis@redhat.com>)
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/netfs54
1 files changed, 53 insertions, 1 deletions
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs
index dc6f78e0..6ca1186d 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