RFC: Addon singleton support
Rob Taylor
rob.taylor at codethink.co.uk
Tue Jun 5 09:19:08 PDT 2007
David Zeuthen wrote:
> On Tue, 2007-06-05 at 12:26 +0100, Rob Taylor wrote:
>>> 1. when killing the s-addon, the runner dies
>>>
>>> 2. when removing the last device [1] for an s-addon the runner also
>>> dies; might be related to item 1.
>>>
>> Ah, yes, looks like I failed to update run_exited, I'll fix up the
>> patch.. (and thanks for the pointer how to test for the last device
>> removed case..)
>
> Cool, I figured it was an easy fix.
>
>>> 5. do you think it's necessary to
>> to...?
>
> Ah, I moved that below. Sorry for the confusion.
>
>>> Do we really want that? I mean; s-addons are supposed to be used by
>>> devices not permanently attached; so it may just happen that the last
>>> device who needs an s-addon is removed; then we should kill the s-addon
>>> just like we do for normal addon's.
>> The problem is that its hald-runner's job to kill addons, so to have
>> hald-runner kill an s-addon would require the addon to communicate
>> directly with it. IMHO this would just be adding more complexity to
>> hald-runner than I'd like. The other option is to have hald tell
>> hald-runner that the singleton is no longer needed with a KillSingleton
>> method. I didn't go this way for fear of race conditions, but I think
>> that would be possible, sending KillSingleton after the s-addon has
>> responded to DeviceRemove.
>>
>> However, either way it's adding more complexity to hald and hald-runner,
>> and I don't really see the need as we need a s-addon to be well behaved
>> anyhow.
>
> Well, there are very real use cases here; you may be running expensive
> (expensive as both CPU utilization / number of wakeups (cf. powertop)
> and memory footprint) code only when one or more devices are attached -
> for example, applications of this that come to mind
>
> - Bluez daemons
> - HPLip
>
> So, for example, my devious plan for Fedora 8 is to change the Bluez
> package such that instead of using a SysV init script it simply provides
> an XML file to start the Bluez daemons as a singleton addon.
>
So, do I understand right that the use case for s-addon killing is
daemons that don't know that they're being used as a singleton addon?
Thanks,
Rob
More information about the hal
mailing list