Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] control which tmpfs get unmounted at swapoff



On Sat, 19 Mar 2016 12:25:14 +0100 Martin Husemann <martin%duskware.de@localhost>
wrote:
> On Sat, Mar 19, 2016 at 10:49:51AM +0100, Ian D. Leroux wrote:
> > Another point that occurred to me last night is that my current
> > script doesn't handle mount points whose paths contain spaces.  Are
> > the rc.d scripts generally robust against space-containing
> > filesystem names?
> 
> I am not sure about the actual state but I'd expect them to be and
> would consider any offenders a bug.

Fair enough.  In that case I need a more robust way of listing all
currently-mounted tmpfs filesystems.  The
  $(mount -t tmpfs | cut -f 3 -d ' ')
hack I'm using right now will truncate paths at the first space.
It also has the problem that it relies on /usr/bin/cut, which is not
necessarily available when the script runs (since /etc/rc.d/swap1
doesn't DEPEND: on mountcritremote).  Short of writing a little C
program to call getmntinfo(3), the only way I currently see is to write
an ed script to munge the output of mount(1) with regexps. Surely there
has to be a better, less brittle way of getting the required
information.  Can anyone give me a hint as to what it might be?

--
IDL


Home | Main Index | Thread Index | Old Index