On 06/12/2017 15:29, Wols Lists wrote:
> On 05/12/17 21:56, Neil Bothwick wrote:
>> On Tue, 05 Dec 2017 10:09:56 +0000, Peter Humphrey wrote:
>>
>>> $ grep tmpfs /etc/fstab
>>> tmpfs   /var/tmp/portage  tmpfs
>>> noatime,uid=portage,gid=portage,mode=0775  0 0
>>> tmpfs   /tmp                      tmpfs
>>> noatime,nosuid,nodev,noexec,mode=1777   0 0
>>
>> Or you could set PORTAGE_TMPDIR to /tmp to save the second mount.
>>
> Dunno why portage puts this stuff in /var/tmp, rather than /tmp, but do
> be aware of what the standard says ...
> 
> Stuff in /tmp should be cleared at shutdown/boot.
> 
> Stuff in /var/tmp should survive a shutdown/boot.
> 
> Of course, if, like me you've put /var/tmp/portage as tmpfs, then of
> course it won't survive a reboot, contrary to spec ... :-)

Those guidelines you mention about what /tmp and /var/tmp are "for" are
probably from the FHS. On the whole, I tend to agree they are good ideas
but the proper wording is more like this (from memory, being far too
lazy after a day's work to actually look something up):

- contents of /tmp are not expected to survive the invocation of the
program that created them
- contents of /var/tmp are not expected to survive a reboot

Which is different from what you said. Not surprisingly, if you follow
that through, you can run rm -rf /tmp/* in a cron every minute and
nothing should ever break. Or, every file in /tmp can be anonymous (just
an inode without a dentry giving it a name)

The thing about standards, is that there are so many to choose from. And
the FHS has never been a standard that anyone paid much attention to.
It's also not a spec, it's a great example of a failed standard that few
if any distros ever bothered following.

Gentoo in particular never bothered following FHS explicitly; any
overlap is mostly accidental. And that is OK as Gentoo devs are
permitted to do whatever they feel like doing. Doubly so if they can
defend their decisions on technical merit.

On the whole, /var/tmp is a better place to put build files than /tmp
just in case someone does take FHS seriously - build files are
necessarily needed after the completion of the program that created them.

And just to round off a mostly pointless discussion with little real
merit, the really stupid thing about portage is why oh why are ports and
distfiles in /usr?

I'll tell you why, it's because that's where FreeBSD puts them, and
drobbins built Gentoo back in the day heavily borrowing from his
pleasant FreeBSD experience (he went there for 6 months recovering from
his departure from another distro, the one with the "toxic
personality"). And no-one ever bothered changing that initial decision -
a classic case of cargo cult


-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to