Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2013 13:10:32 +0200 (CEST)
From:      Harald Schmalzbauer <freebsd@omnilan.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   misc/182035: /etc/rc.d/tmp can't create tmpmfs on root-mfs
Message-ID:  <201309121110.r8CBAW0f034660@preed.labshop.wdn.omnilan.net>
Resent-Message-ID: <201309121120.r8CBK18b052713@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         182035
>Category:       misc
>Synopsis:       /etc/rc.d/tmp can't create tmpmfs on root-mfs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 12 11:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Harald Schmalzbauer
>Release:        FreeBSD 9.2-RC1 amd64
>Organization:
OmniLAN
>Environment:
System: FreeBSD preed.labshop.wdn.omnilan.net 9.2-RC1 FreeBSD 9.2-RC1 #0 r254055: Wed Aug 7 17:18:19 CEST 2013 admin@preed.labshop.wdn.omnilan.net:/usr/local/share/deploy-tools/obj-amd64/usr/local/share/deploy-tools/RELENG_9_2/src/sys/GENERIC amd64


	
>Description:
	On startup, /etc/rc.d/tmp checks if /tmp is writable, and if not,
creates a memory-disk filesystem for /tmp.
Before actually creating, there's an additional check to see if /tmp is
already a memory-disk, which returns false positive, if the
root filesystem is a memory-disk!
>How-To-Repeat:
	Boot any setup with root_mfs read-only, and leave tmpmfs="AUTO".
/etc/rc.d/tmp will recognize that /tmp is not writable, but refuses to create
the memorydisk, because 'df' with '/tmp'  and 'md[0-9]' as regex returns
false positive.
>Fix:

--- src/etc/rc.d/tmp.orig	2013-09-11 20:43:25.000000000 +0200
+++ src/etc/rc.d/tmp	2013-09-11 20:48:46.000000000 +0200
@@ -39,7 +39,7 @@
 
 mount_tmpmfs ()
 {
-	if ! /bin/df /tmp | grep -q "^/dev/md[0-9]"; then
+	if ! /sbin/mount | grep -q "^/dev/md[0-9].\+/tmp[[:blank:]]"; then
 		mount_md ${tmpsize} /tmp "${tmpmfs_flags}"
 		chmod 01777 /tmp
 	fi


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309121110.r8CBAW0f034660>