Friday 29 May 2020

Re: Adjusting what fstypes df displays

On Fri, May 29, 2020 at 10:31:56AM -0400, Sergio Durigan Junior wrote:
> On Friday, May 29 2020, Bryce Harrington wrote:
> > I've drafted a POC implementation for df here:
> >
> > https://github.com/bryceharrington/coreutils/commit/cc372d778b44abcf81af42743a5174685f9bb4db
>
> Hey Bryce,
>
> Overall I like the idea of using an environment variable to control this
> behaviour, but I feel compelled to raise the point of discoverability.
>
> If the distro ships a file under /etc/profile.d/ which silently sets
> this variable for all users, and if the user is not aware of that, it
> may take her some non-trivial effort to figure out why her tmpfs mount
> is being listed by df.
>
> I'm sure you must have thought of that, but if you go forward with the
> environment variable idea, extra care will need to be taken when writing
> the documentation for it. Perhaps (and that's a big "perhaps"; I
> haven't thought much about it) it's even worth mentioning somehow that
> DF_EXCLUDE_FSTYPES is being used in the output of df,

It's a good point. My plan is to mention it in --help, and also add an
ENVIRONMENT section to the df man page, since at least to me that'd be
the second and third places I'd look (the first being google
obviously...) I notice that df has a couple other environment variables
(POSIXLY_CORRECT and DF_BLOCK_SIZE) mentioned in --help but not the man
page, which could go in as well.

This is probably too low-level to be worth including in the Groovy
release notes, but I can propose a sentence or two just for some extra
visibility.

> or having a new
> "--full-output" option (or some such) that would ignore the variable and
> print everything.

There is a 'df --all' option that sounds like it should suit that need.
Thanks for raising this idea -- in testing it I notice the new code
isn't honoring it. I'll add a check to skip the env var if -a,--all is
specified.

> I kind of like the idea of a configuration file, but I agree that an
> environment variable is more flexible. Also, I don't think the creation
> of a configuration file would be justified for just this single option.

Yeah, those were my thoughts as well. df itself doesn't currently use a
config file, but I wonder if coreutils itself has something.

> Let me know when you submit the patch upstream; I'm interested in
> following the discussions :-).

Sure thing,
Bryce

--
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel