Bug 57659

Summary: Exit status from /etc/rc.d/mountcritlocal is ignored
Product: Base System Reporter: Yar Tikhiy <yar>
Component: confAssignee: Doug Barton <dougb>
Status: Closed FIXED    
Severity: Affects Only Me CC: mtm
Priority: Normal    
Version: 5.1-CURRENT   
Hardware: Any   
OS: Any   

Description Yar Tikhiy 2003-10-06 18:50:21 UTC
	System startup will continue despite /etc/rc.d/mountcritlocal
	has failed.

	This may be a manifestation of a more general problem in rcNG.

How-To-Repeat: 	Try to boot with an unmountable FS in /etc/fstab, e.g.:

	/dev/nodev	/mnt	ufs	rw	0	0
							^ so fsck won't fail
Comment 1 Yar Tikhiy 2003-10-07 14:35:34 UTC
As my further investigation has revealed, it's just a problem of
/etc/rc.d/mountcritlocal.  It should stop startup on a mount failure,
but won't actually.  I'd suggest applying the patch attached.  By
the way, the script /etc/rc.d/mountcritremote seems to have the
same problem.

-- 
Yar

--- /usr/src/etc/rc.d/mountcritlocal	Mon Jun  2 19:45:55 2003
+++ ./mountcritlocal	Tue Oct  7 16:44:28 2003
@@ -43,6 +43,9 @@
 		*)
 			echo 'Mounting /etc/fstab filesystems failed,' \
 			    ' startup aborted'
+			if [ "$autoboot" = yes ]; then
+				kill -TERM $$
+			fi
 			exit 1
 			;;
 		esac
Comment 2 Kris Kennaway freebsd_committer freebsd_triage 2003-10-18 01:45:51 UTC
Responsible Changed
From-To: freebsd-bugs->dougb

Assign to rc.d maintainer
Comment 3 Mike Makonnen 2003-12-01 11:53:32 UTC
On Tue, Oct 07, 2003 at 05:35:34PM +0400, Yar Tikhiy wrote:
> As my further investigation has revealed, it's just a problem of
> /etc/rc.d/mountcritlocal.  It should stop startup on a mount failure,
> but won't actually.  I'd suggest applying the patch attached.  By
> the way, the script /etc/rc.d/mountcritremote seems to have the
> same problem.
> 
> -- 
> Yar
> 
> --- /usr/src/etc/rc.d/mountcritlocal	Mon Jun  2 19:45:55 2003
> +++ ./mountcritlocal	Tue Oct  7 16:44:28 2003
> @@ -43,6 +43,9 @@
>  		*)
>  			echo 'Mounting /etc/fstab filesystems failed,' \
>  			    ' startup aborted'
> +			if [ "$autoboot" = yes ]; then
> +				kill -TERM $$
> +			fi
>  			exit 1
>  			;;
>  		esac

Quite correct. I've requested permission from re to commit this and a similar
patch.

Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
mtm@identd.net | Fingerprint: 00E8 61BC 0D75 7FFB E4D3  6BF1 B239 D010 3215 D418
mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon !
Comment 4 Mike Makonnen freebsd_committer freebsd_triage 2003-12-09 08:39:16 UTC
State Changed
From-To: open->closed

Fixed. 

Thanks!