[packagekit] Python fork() question

David Zeuthen david at fubar.dk
Tue Mar 4 09:38:28 PST 2008


On Tue, 2008-03-04 at 13:05 +0100, Sebastian Heinlein wrote:
> Am Montag, den 03.03.2008, 13:25 -0500 schrieb Robin Norwood:
> > On Mon, 03 Mar 2008 16:09:50 +0000
> > Richard Hughes <hughsient at gmail.com> wrote:
> > 
> > > On Mon, 2008-03-03 at 16:46 +0100, Sebastian Heinlein wrote:
> > > > Could we perhaps use a simple worker which is based on
> > > > threading.thread?
> > > 
> > > If you think you can do better than fork (and I'm a complete novice
> > > when it comes to all this unix stuff) then feel free to have a play
> > > and commit on the origin/forked-dbus-backend branch. If it works
> > > better than rnorwoods fork then we can merge to master.
> > 
> > Yeah, I went with forking because:
> > 
> > a) I'm more familiar with forking than threading
> 
> It seems that forking is not well supported by dbus:
> 
> http://lists.freedesktop.org/archives/dbus/2007-April/007508.html
> 
> Is this still the case, David?

It's not whether forking is well supported or not; of course a process
can inherit the connection (assuming no one else is using it). 

The thing is that you can't expect the child to inherit the connection
and have things like PolicyKit work well; it'll think it's the parent
process id. So, the rule of thumb with D-Bus is that if you fork every
child process needs to connect to the system message bus on their own.

      David




More information about the PackageKit mailing list