[Sugar-devel] OT: waiting for non-child processes on Linux
bobbypowers at gmail.com
Sat Nov 7 10:55:13 EST 2009
On Fri, Nov 6, 2009 at 5:28 PM, Sascha Silbe
<sascha-ml-ui-sugar-devel at silbe.org> wrote:
> For the sugar-datastore test suite, I'd like to run each test at a clean
> state, i.e. from an empty directory and using a new data store service
> process (esp. important for migration tests which I'm currently working on).
> To ensure that, I need to
> a) find out the process id of the current data store service process
> (moderately easy, already implemented)
> b) kill it and
> c) wait for it to die.
> The last part is suprisingly hard as it's a distant cousin (started by
> dbus-daemon, so even different session and group id) and wait*() only work
> for immediate child processes. POSIX allows implementations to provide
> extensions that support waiting for arbitrary processes, I couldn't find any
> system call on Linux that does so (but might have overlooked one).
> Even starting a new process hierarchy (including dbus-daemon) from the
> top-level process for each single test case wouldn't help since dbus-daemon
> and its children (esp. the data store service process) cannot be waited for.
> Any idea on how to accomplish the given goal (without resorting to hacks
> like periodically starting pgrep)?
There have been some people implementing a userspace kqueue library
for Linux (partly to get Grand Central Dispatch running), who have the
same problem. I don't think they have an answer yet, but you might
bring it up on their mailing list
> CU Sascha
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> -----END PGP SIGNATURE-----
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
More information about the Sugar-devel