:: Re: [DNG] Fwd: For all you automoun…
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Didier Kryn
Fecha:  
A: dng
Asunto: Re: [DNG] Fwd: For all you automounter programmers
Le 03/05/2016 14:48, hellekin a écrit :
> On 05/03/2016 12:16 PM, Jim Murphy wrote:
>> Problem, blkid uses a cache that is only updated when root runs blkid.
>> Any changes are not automatically updated. A user only sees the cache.
>>
>> The issues is, fsr is trying to do everything as a "user" so tools like
>> lsblk and blkid don't work for this case. For blkid, the cache will not
>> be up to date when say a flash-drive is add/or removed.
>>
> You might be interested in using jaromil's version of sup to compile a
> static binary that will elevate privilege for "that" user running *blk*
> commands. Not as sexy as running without root, but a good use-case for
> the new hashing functionality of sup.
>
> https://git.devuan.org/jaromil/sup
>


     Until I can see this myself (this evening at home on devuan-jessie) 
I assume the hotplug manager will invoke blkid upon insertion of the 
device, and therefore it will take care of updating blkid's cache. This 
is consistent with the very idea of having a cache; it would make no 
sense otherwise. blkid is explicitely designed to be invoked by udev (it 
has an "udev" formatting switch) and we know vdev invokes it as well.


     I can see possible reasons why it wouldn't be invoked:


     1) the system doesn't use a hotplugger (either static, or devtmpfs)
     2) udev has been replaced by eudev and eudev does otherwise.
     3) udev now makes function calls to blkid's library instead of 
invoking the program, and the cache is only maintained by the program.



      Jim, did you try '/sbin/blkid -c /dev/null' ? This bypasses the 
cache. For me, it shows only the hot-plugged devices and not the main 
hard disk.



        Didier