how to do large-ish IPC transfers

Brad Bishop bradleyb at fuzziesquirrel.com
Thu Sep 12 23:24:37 AEST 2019


at 6:30 AM, Alexander Amelkin <a.amelkin at yadro.com> wrote:

> 11.09.2019 21:31, Vernon Mauery wrote:
>> On 11-Sep-2019 01:49 PM, Brad Bishop wrote:
>>> Hi everyone
>>>
>>> I have an application or two that need to collect and save ~ 16KiB of
>>> debugging data.  The applications have various triggers but they are very
>>> infrequent when deployed (on the order of months/years).  In the lab it
>>> would happen much more frequently.  It isn’t really debugging information
>>> for the developer of the application but rather for customer service
>>> personnel debugging broken components on a deployed server, after the  
>>> event
>>> (and state) that caused the data to be collected.
>>>
>>> The applications generating this data will not be the same applications  
>>> that
>>> publish it (the webserver), so there is a need to transfer it using IPC.
>>>
>>> 16KiB seemed a little big for a DBus interface, and we’d have to ascii
>>> encode all that into a string.  Some other ideas were:
>>>
>>> 1 - passing a file descriptor over dbus
>> This would probably be the best, given our architecture. It would allow,
>> at some point in the future, to have the sender have different
>> permissions on the file and allow access to a less-privileged process.
>
> What is a 'file descriptor' you're referring to here? The Linux file  
> descriptor
> (the integer you get from open()) is process-specific and doesn't keep its
> meaning in another process' context.

On Linux you can pass file descriptors (the ones returned by open) over  
unix sockets.  The implementation of the ‘h’ DBus type relies on that.


More information about the openbmc mailing list