Re: REVIEW: cleanvar.patch

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Mon, 19 Jan 2004 22:25:11 +0100
In message <20040119212006.GA8895_at_Odin.AC.HMC.Edu>, Brooks Davis writes:
>
>--sm4nu43k4a2Rpi4c
>Content-Type: text/plain; charset=us-ascii
>Content-Disposition: inline
>Content-Transfer-Encoding: quoted-printable
>
>You might want to post this to the FreeBSD-rc list
>(freebsd-rc_at_yahoogroups.com).

This patch is as far as I needed it to go and I don't really
have time to get to know all the rc systems internal details.

I'll be more than happy if the rc crew will pickup on this
idea, you seem to be aware of a lot of stuff I'm not in this
context.

Poul-Henning


>On Mon, Jan 19, 2004 at 09:49:19PM +0100, Poul-Henning Kamp wrote:
>>=20
>>=20
>> This patch adds code which detects an read-only /var and puts
>> a MD(4) disk on it in that case.
>>=20
>> This is really a move of some diskless specific code to the
>> more general use of read-only rootfs systems.
>
>Overall this seems like a good idea.  I'm not sure cleanvar is the right
>place (as opposed to a new script cleanvar depends on), but this is
>probably as good as any.
>
>> +# Provide a function for normalizing the mounting of memory
>> +# filesystems.  This should allow the rest of the code here to remain
>> +# as close as possible between 5-current and 4-stable.
>> +#   $1 =3D size
>> +#   $2 =3D mount point
>> +#   $3 =3D (optional) bytes-per-inode
>> +mount_md() {
>> +	if [ -n "$3" ]; then
>> +		bpi=3D"-i $3"
>> +	fi
>> +	/sbin/mdmfs $bpi -s $1 -M md $2
>> +}
>
>Since this would now appear in three files, maybe it should go in
>/etc/rc.subr.
>
>> +# Populate /var if it looks empty
>> +if [ -d /var/run -a -d /var/db -a -d /var/empty ] ; then
>> +	true
>> +else
>> +	/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var > /dev/null 2>&1
>
>You also need to create the sendmail files if sendmail is enabled:
>
>case ${sendmail_enable} in
>[Nn][Oo][Nn][Ee])
>	;;
>*)
>	/usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p / > /dev/null
>	;;
>esac
>
>
>> +	LOGFILES=3D`/usr/bin/awk '$1 !=3D "#" { printf "%s ", $1 } ' /etc/newsy=
>slog.conf`
>> +	if [ -n "$LOGFILES" ]; then
>> +		/usr/bin/touch $LOGFILES
>> +	fi
>
>It's kind of lame that we have to do this when newsyslog has the -CC
>option.  I guess we're stuck with it given we don't have /usr yet.
>
>> +	/usr/bin/touch /var/log/lastlog
>> +
>> +fi
>
>-- Brooks
>
>--=20
>Any statement of the form "X is the one, true Y" is FALSE.
>PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
>
>--sm4nu43k4a2Rpi4c
Content-Type: application/pgp-signature
>Content-Disposition: inline
>
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.1 (GNU/Linux)
>
>iD8DBQFADEoDXY6L6fI4GtQRAkLzAJ0dZZxDl5sKPUiuKlUx3cBe5/MohQCghGh0
>yMzbRTGV68VQr7unBq0F+Oo=
>=Z0TS
>-----END PGP SIGNATURE-----
>
>--sm4nu43k4a2Rpi4c--
>

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Mon Jan 19 2004 - 12:25:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:39 UTC