[Pkg-sysvinit-commits] r181 - sysvinit/trunk/debian/initscripts/etc/init.d

Thomas Hood jdthood-guest at costa.debian.org
Mon Nov 21 11:45:27 UTC 2005


Author: jdthood-guest
Date: 2005-11-21 11:45:27 +0000 (Mon, 21 Nov 2005)
New Revision: 181

Modified:
   sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh
Log:
Make mountnfs work like mountall in the way it prints messages about mounting; fix indentation; improve messages

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh	2005-11-21 11:34:08 UTC (rev 180)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh	2005-11-21 11:45:27 UTC (rev 181)
@@ -28,107 +28,100 @@
 	#	Run in a subshell because of I/O redirection.
 	#
 	test -f /etc/fstab && (
-
-	#
-	#	Read through fstab line by line. If it is NFS, set the flag
-	#	for mounting NFS file systems. If any NFS partition is found and it
-	#	not mounted with the nolock option, we start the portmapper.
-	#
-	portmap=no
-	while read device mountpt fstype options
-	do
-		case "$device" in
-			""|\#*)
+		#
+		# Read through fstab line by line. If it is NFS, set the flag
+		# for mounting NFS file systems. If any NFS partition is found and it
+		# not mounted with the nolock option, we start the portmapper.
+		#
+		portmap=no
+		while read device mountpt fstype options
+		do
+			case "$device" in
+			  ""|\#*)
 				continue
 				;;
-		esac
-
-		case "$options" in
-			*noauto*)
+			esac
+			case "$options" in
+			  *noauto*)
 				continue
 				;;
-		esac
-
-		case "$fstype" in
-			nfs|nfs4)
+			esac
+			case "$fstype" in
+			  nfs|nfs4)
 				case "$options" in
-					*nolock*)
-						;;
-					*)
-						portmap=yes
-						;;
+				  *nolock*)
+					;;
+				  *)
+					portmap=yes
+					;;
 				esac
 				;;
-			smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs)
+			  smbfs|cifs|coda|ncp|ncpfs|ocfs2|gfs)
 				;;
-			*)
+			  *)
 				fstype=
 				;;
-		esac
-		if [ -n "$fstype" ]
-		then
-			case "$NETFS" in
-				$fstype|*,$fstype|$fstype,*|*,$fstype,*)
+			esac
+			if [ -n "$fstype" ]
+			then
+				case "$NETFS" in
+				  $fstype|*,$fstype|$fstype,*|*,$fstype,*)
 					;;
-				*)
+				  *)
 					NETFS="$NETFS${NETFS:+,}$fstype"
 					;;
-			esac
+				esac
+			fi
+		done
+		exec 0>&1
+		if [ "$portmap" = yes ]
+		then
+			if [ -x /sbin/portmap ] && [ -z "`pidof portmap`" ] 
+			then
+				if [ -x /etc/init.d/portmap ] 
+				then
+					/etc/init.d/portmap start
+			        else
+					log_action_begin_msg "Starting portmap"
+					start-stop-daemon --start --quiet --exec /sbin/portmap
+					sleep 2  # FIXME: Actually synchronize with the process?
+					log_action_end_msg $?
+				fi
+			fi
 		fi
-	done
-
-	exec 0>&1
-
-	if [ "$portmap" = yes ]
-	then
-		if [ -x /sbin/portmap ] && [ -z "`pidof portmap`" ] 
+		if [ -n "$NETFS" ]
 		then
-			if [ -x /etc/init.d/portmap ] 
+			log_action_msg "Will now mount remote filesystems"
+			mount -a -t$NETFS
+			ES=$?
+			if [ "$ES" = 0 ]
 			then
-				/etc/init.d/portmap start
-		        else
-				log_action_begin_msg "Starting portmap"
-				start-stop-daemon --start --quiet --exec /sbin/portmap
-				sleep 2
-				log_action_end_msg $?
+				log_success_msg "Done mounting remote filesystems"
+			else
+				log_failure_msg "Mounting remote filesystems failed with error code ${ES}."
 			fi
 		fi
-	fi
-
-	if [ -n "$NETFS" ]
-	then
-	(
-		log_action_begin_msg "Mounting remote filesystems"
-		if mount -a -t$NETFS ; then
-			log_action_end_msg 0
-		else
-			log_action_end_msg 1
-		fi
-	) 2>&1 | egrep -v '(already|nothing was) mounted'
-	fi
-
 	) < /etc/fstab
 
-	#
-	#       Clean /tmp, /var/lock, /var/run
-	#
+	# Clean /tmp, /var/lock, /var/run
 	bootclean mountnfs
 }
 
 case "$1" in
-    start)
-        do_start
-        ;;
-    restart|reload|force-reload)
-        echo "Error: argument '$1' not supported" >&2
-        exit 3
-        ;;
-    stop)
-        ;;
-    *)
-        echo "Usage: $0 start|stop" >&2
-        exit 3
-        ;;
+  start)
+	do_start
+	;;
+  restart|reload|force-reload)
+	echo "Error: argument '$1' not supported" >&2
+	exit 3
+	;;
+  stop)
+	# No-op
+	;;
+  *)
+	echo "Usage: $0 start|stop" >&2
+	exit 3
+	;;
 esac
 
 : exit 0




More information about the Pkg-sysvinit-commits mailing list