Bug 8934 - Reset activated process' priority and create new process group for it
Summary: Reset activated process' priority and create new process group for it
Status: RESOLVED WONTFIX
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: All All
: lowest enhancement
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL:
Whiteboard: review-
Keywords: love, patch
Depends on:
Blocks:
 
Reported: 2006-11-07 07:20 UTC by Kimmo Hämäläinen
Modified: 2014-09-23 15:47 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (786 bytes, patch)
2006-11-07 07:20 UTC, Kimmo Hämäläinen
Details | Splinter Review
proposed patch for dbus 1.3 (1.51 KB, patch)
2010-03-17 01:03 UTC, Kimmo Hämäläinen
Details | Splinter Review
reset priority and scheduler, and make a process group (1.45 KB, patch)
2011-01-05 10:35 UTC, Simon McVittie
Details | Splinter Review

Description Kimmo Hämäläinen 2006-11-07 07:20:24 UTC
Here is an internal patch that we're using in Nokia 770, it does the following:

1) Sets the activated process' priority to the default priority (0). This allows
prioritising the daemon differently from the activated process.

2) Creates a new session and process group for the activated process. This
allows sending a signal to the whole process group with killpg().
Comment 1 Kimmo Hämäläinen 2006-11-07 07:20:58 UTC
Created attachment 7687 [details] [review]
proposed patch
Comment 2 Havoc Pennington 2006-11-07 08:35:36 UTC
Thanks for the patch. I assume this is aimed at the system bus? It doesn't 
seem appropriate for the session bus necessarily; there, apps in the session 
probably should remain in the same session group, and if the session has a 
special priority it should likely keep it. This would argue for some kind of 
config flag for whether to do this (and in fact, for whether the main bus 
should change its own priority)

John, let's aim for 1.0.1 or something on this rather than break 1.0.0 freeze, 
no?

Comment 3 John (J5) Palmieri 2006-11-07 08:46:06 UTC
I agree with waiting until 1.0.1.  Embeded users can patch for now and when 1.0
comes out pretty soon we can branch and commit this to HEAD and a 1.0.1 branch. 
Comment 4 John (J5) Palmieri 2007-10-09 12:40:10 UTC
Hmm, this never got applied.  I'm wondering if this doesn't make sense for the session do we need to add code to only do this when system activating
Comment 5 Havoc Pennington 2007-10-09 12:44:01 UTC
A couple other notes on this patch,
 - there's a brace in the wrong spot
 - I'm not sure the _dbus_warn is a good idea, since it either can't happen or will happen, and printing to stderr is not really going to be visible. Probably need to either return the error, assert() that it did not fail, or just silently let it fail, depending on why/when it might fail.
Comment 6 Benjamin Close 2008-01-11 02:36:48 UTC
Bugzilla Upgrade Mass Bug Change

NEEDSINFO state was removed in Bugzilla 3.x, reopening any bugs previously listed as NEEDSINFO.

  - benjsc
    fd.o Wrangler
Comment 7 Colin Walters 2009-07-13 11:11:50 UTC
We could probably move this patch into the system activation helper binary.
Comment 8 Colin Walters 2010-03-16 09:36:03 UTC
Is there a version of this patch rebased to current dbus-1.2?
Comment 9 Kimmo Hämäläinen 2010-03-17 00:38:34 UTC
I'll ask the current Maemo D-Bus maintainer...
Comment 10 Kimmo Hämäläinen 2010-03-17 01:03:32 UTC
Created attachment 34136 [details] [review]
proposed patch for dbus 1.3

Here is the current patch we are using. Just remove that #ifdef garbage from the beginning.
Comment 11 Simon McVittie 2011-01-05 10:35:41 UTC
Created attachment 41679 [details] [review]
reset priority and scheduler, and make a process group

I don't think Attachment #34136 [details] is the patch you meant to attach: it replaces setgroups() with initgroups(), which is orthogonal to this discussion.

Here's the one I think you meant? (taken from <http://maemo.gitorious.org/maemo-gnome-essentials/dbus>)
Comment 12 Chengwei Yang 2013-09-29 06:38:49 UTC
Comment on attachment 41679 [details] [review]
reset priority and scheduler, and make a process group

Review of attachment 41679 [details] [review]:
-----------------------------------------------------------------

It calls setsid rather than setpgid so if it's a user session service will be activaed, then it will out of the user's session. I think that's incorrect.
Comment 13 Simon McVittie 2013-09-30 11:25:40 UTC
I suspect the long-term answer to this is WONTFIX: systemd-based activation (or, in Ubuntu's patchset, Upstart-based activation) isolates activated processes much better than dbus-daemon ever could.

I suspect the best way to have better isolation on non-systemd, non-Upstart systems would be to have a daemon running as root which implements the (small) subset of systemd's API that dbus-daemon uses.
Comment 14 Simon McVittie 2014-09-23 15:47:20 UTC
(In reply to comment #13)
> I suspect the long-term answer to this is WONTFIX: systemd-based activation
> (or, in Ubuntu's patchset, Upstart-based activation) isolates activated
> processes much better than dbus-daemon ever could.

Doing so.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.