bug-hurd
[Top][All Lists]
Advanced

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

Re: A translator for `/dev/shm'


From: olafBuddenhagen
Subject: Re: A translator for `/dev/shm'
Date: Tue, 3 Apr 2007 15:16:56 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hi,

On Tue, Apr 03, 2007 at 01:52:09AM +0200, Thomas Schwinge wrote:

> It was reported that the `tmpfs' translator doesn't really work and is
> thus not usable for being installed on `/dev/shm', so I propose the
> following for the mean time:
> 
> #v+
> $ sudo settrans -cpgf /dev/shm /bin/sh -c 'settrans -cagf 
> /var/cache/dev_shm.backend /hurd/storeio -T copy:zero 2M && mkfs.ext2 -F -b 
> 4096 -o hurd /var/cache/dev_shm.backend && /hurd/ext2fs 
> /var/cache/dev_shm.backend & while sleep 1 && ! test -d /dev/shm/.; do echo 
> Waiting for /dev/shm to get ready... >&2; done && fsysopts /dev/shm 
> --no-inherit-dir-group && chmod 1777 /dev/shm'
> #v-
> 
> ... or something like that.
> 
> 
> Note that this is not a April Fool's joke, but actually works.

It's sure a good way to impress newbies... ;-)

However, it is incorrect: The first programm to access it, will see the
original setup -- and thus fail.

Here is a variant that actually works:

   settrans /dev/shmtest /bin/sh -c 'settrans -cagf /var/cache/dev_shm.backend 
/hurd/storeio -T copy:zero 2M && mkfs.ext2 -F -b 4096 
/var/cache/dev_shm.backend && settrans -cagf /var/cache/dev_shm.temp 
/hurd/ext2fs /var/cache/dev_shm.backend && chmod 1777 /var/cache/dev_shm.temp 
&& settrans -ga /var/cache/dev_shm.temp && exec /hurd/ext2fs.static 
--no-inherit-dir-group /var/cache/dev_shm.backend'

(BTW, fsysopts reports --[no-]inherit-dir-group exactly reversed! No
idea whether the bug is actually in fsysopts handling, or in startup
command line parsing, i.e. which one is really used...)

Aside from that, I'm pretty sure /var/cache is *not* the right location
for this. And when at nitpicking, I would call it "store" instead of
"backend" :-)

As I already pointed out, -o hurd is unnecessary.

Last but not least, as I mentioned twice already, /hurd/ext2fs probably
doesn't work for shm! (At least it didn't when I last tried it.) You
need to used /hurd/ext2fs.static instead. (Or fix the non-static
variant...)

-antrik-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]