From owner-freebsd-rc@FreeBSD.ORG Mon Nov 8 14:37:54 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F421F16A4CE for ; Mon, 8 Nov 2004 14:37:53 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id A851343D54 for ; Mon, 8 Nov 2004 14:36:41 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])iA8EaFON031186; Mon, 8 Nov 2004 16:36:25 +0200 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) iA8EYxoP000883; Mon, 8 Nov 2004 16:36:03 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost)iA8EXaed000869; Mon, 8 Nov 2004 16:33:36 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Mon, 8 Nov 2004 16:33:36 +0200 From: Giorgos Keramidas To: Mike Makonnen Message-ID: <20041108143336.GB784@orion.daedalusnetworks.priv> References: <20041108005007.GB57736@gothmog.gr> <20041108105120.GA952@orion.daedalusnetworks.priv> <20041108114402.GA2910@rogue.acs.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041108114402.GA2910@rogue.acs.lan> cc: freebsd-rc@freebsd.org Subject: Re: RFC (fwd) Re: 5.3 tmpfs mount permissions X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to /etc/rc.d design and implementation. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2004 14:37:54 -0000 On 2004-11-08 14:44, Mike Makonnen wrote: > I haven't tested it, but I don't see anything obviously wrong with it. > > Cheers. How about this one? There are no tricky parts in mount_md() anymore and the tmpfs_flags variable is passed to mdmfs. I just rebooted with it, with tmpfs=30m and tmpfs=YES in my rc.conf and all seemed to work fine. I've kept the tmpsize and varsize options too. I know they can be replaced by a properly tweaked tmpmfs_flags, but this isn't really necessary. %%% Index: etc/rc.subr =================================================================== RCS file: /home/ncvs/src/etc/rc.subr,v retrieving revision 1.31 diff -u -u -r1.31 rc.subr --- etc/rc.subr 30 Jul 2004 17:19:35 -0000 1.31 +++ etc/rc.subr 8 Nov 2004 13:55:04 -0000 @@ -1289,12 +1289,12 @@ # as close as possible between 5-current and 4-stable. # $1 = size # $2 = mount point -# $3 = (optional) bytes-per-inode +# $3 = (optional) extra mdmfs flags mount_md() { if [ -n "$3" ]; then - bpi="-i $3" + flags="$3" fi - /sbin/mdmfs $bpi -s $1 -M md $2 + /sbin/mdmfs $flags -s $1 -M md $2 } fi Index: etc/defaults/rc.conf =================================================================== RCS file: /home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.226 diff -u -u -r1.226 rc.conf --- etc/defaults/rc.conf 20 Oct 2004 16:58:27 -0000 1.226 +++ etc/defaults/rc.conf 8 Nov 2004 13:58:23 -0000 @@ -40,8 +40,10 @@ removable_interfaces="" # Removable network interfaces for /etc/pccard_ether. tmpmfs="AUTO" # Set to YES to always create an mfs /tmp, NO to never tmpsize="20m" # Size of mfs /tmp if created +tmpmfs_flags="-S -o noexec,nosuid,nodev" # Extra mdmfs options for the mfs /tmp varmfs="AUTO" # Set to YES to always create an mfs /var, NO to never varsize="32m" # Size of mfs /var if created +varmfs_flags="-S" # Extra mount options for the mfs /var populate_var="AUTO" # Set to YES to always (re)populate /var, NO to never local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs. script_name_sep=" " # Change if your startup scripts' names contain spaces Index: etc/rc.d/tmp =================================================================== RCS file: /home/ncvs/src/etc/rc.d/tmp,v retrieving revision 1.34 diff -u -u -r1.34 tmp --- etc/rc.d/tmp 7 Oct 2004 13:55:26 -0000 1.34 +++ etc/rc.d/tmp 8 Nov 2004 14:27:55 -0000 @@ -42,7 +42,7 @@ # case "${tmpmfs}" in [Yy][Ee][Ss]) - mount_md ${tmpsize} /tmp + mount_md ${tmpsize} /tmp "${tmpmfs_flags}" chmod 01777 /tmp ;; [Nn][Oo]) @@ -56,7 +56,7 @@ echo "dropping into shell, ^D to continue anyway." /bin/sh else - mount_md ${tmpsize} /tmp + mount_md ${tmpsize} /tmp "${tmpmfs_flags}" chmod 01777 /tmp fi fi Index: etc/rc.d/var =================================================================== RCS file: /home/ncvs/src/etc/rc.d/var,v retrieving revision 1.34 diff -u -u -r1.34 var --- etc/rc.d/var 7 Oct 2004 13:55:26 -0000 1.34 +++ etc/rc.d/var 8 Nov 2004 14:28:19 -0000 @@ -61,7 +61,7 @@ # case "${varmfs}" in [Yy][Ee][Ss]) - mount_md ${varsize} /var + mount_md ${varsize} /var "${varmfs_flags}" ;; [Nn][Oo]) ;; @@ -69,7 +69,7 @@ if (/bin/mkdir -p /var/.diskless 2> /dev/null); then rmdir /var/.diskless else - mount_md ${varsize} /var + mount_md ${varsize} /var "${varmfs_flags}" fi esac Index: share/man/man5/rc.conf.5 =================================================================== RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v retrieving revision 1.232 diff -u -u -r1.232 rc.conf.5 --- share/man/man5/rc.conf.5 23 Oct 2004 18:35:35 -0000 1.232 +++ share/man/man5/rc.conf.5 8 Nov 2004 14:04:58 -0000 @@ -240,6 +240,22 @@ Controls the size of a created .Pa /tmp memory file system. +.It Va tmpmfs_flags +Extra options passed to the +.Xr mdmfs 8 +utility when the memory file system for +.Pa /tmp +is created. +The default is +.Dq Li -S -o noexec,nosuid,nodev , +which inhibits the use of softupdates on +.Pa /tmp +to waste as little space as possible and mounts the memory file system +.Dq Li noexec,nosuid,nodev . +See +.Xr mdmfs 8 +for other options you can use in +.Li tmpmfs_flags . .It Va varmfs Controls the creation of a .Pa /var @@ -255,6 +271,21 @@ Controls the size of a created .Pa /var memory file system. +.It Va varmfs_flags +Extra options passed to the +.Xr mdmfs 8 +utility when the memory file system for +.Pa /var +is created. +The default is +.Dq Li -S , +which inhibits the use of softupdates on +.Pa /var +to waste as little space as possible. +See +.Xr mdmfs 8 +for other options you can use in +.Li varmfs_flags . .It Va populate_var Controls the automatic population of the .Pa /var @@ -3095,6 +3126,7 @@ .Xr kldxref 8 , .Xr lpd 8 , .Xr mdconfig 8 , +.Xr mdmfs 8 , .Xr mountd 8 , .Xr moused 8 , .Xr mrouted 8 , %%%