Rcorder/rc.conf question on FILESYSTEMS and tmp

Matthew Seaman matthew at FreeBSD.org
Thu Oct 19 06:13:43 UTC 2017


On 18/10/2017 18:05, Christopher Sean Hilton wrote:
> In my other question I asked if I should use a swap backed, /dev/md
> based tmpfs for /tmp. The actual problem that brings up the issue is
> this: When I reconfigured my system from zfs based /tmp to swap back
> /dev/md based tmpfs, I screwed up the permissions on the "/tmp"
> directory. This caused slapd to fail at startup time because it
> couldn't create some file or something in /tmp. I've fixed the problem
> and moved on but this leaves a question:
> 
>      1) Shouldn't /etc/rc.d/FILESYSTEMS require "tmp" before it starts
>         up?
> 
> My usage requires slapd so I can patch this for now by adding "tmp" to
> slapd's requirements but I'm very interested in the answer to the
> reasons behind this question if the answer is "no". If the answer is
> yes, then I just owe you a well written bug report.
> 

FILESYSTEMS requires mountcritlocal.  mountcritlocal mounts all local
filesystems from /etc/fstab which generally includes mounting /tmp

Hmmm.... there is a /etc/rc.d/tmp which is different from just using
tmpfs in /etc/fstab -- and it's the latter which I'd recommend you to
implement.

Looks like /etc/rc.d/tmp mounts a tmpmfs, which is a slightly different
concept and the startup script only does anything if a /tmp does not
already exist.  In practice that would generally be limited to diskless
setups and other speciality systems.

Any other method for mounting /tmp than using /etc/rc.d/tmp will be
based on /etc/fstab and come under mountcritlocal.  That will mean that
/tmp is mounted and available well before any daemons get started up.
That covers the vast majority of systems.  tmp not being mentioned in
FILESYSTEMS is arguably a bug, but that's something people on
freebsd-fs at freebsd.org would be much better placed to answer.

	Cheers,

	Matthew


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20171019/f5479805/attachment.sig>


More information about the freebsd-questions mailing list