[gnome-shell] ibusManager: Avoid double fork triggering parent death in ibus
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] ibusManager: Avoid double fork triggering parent death in ibus
- Date: Sat, 2 Jul 2022 16:15:04 +0000 (UTC)
commit 8e87ff29752f4a7cd919795a59a4a03bbb114c4a
Author: oreo639 <oreo6391 gmail com>
Date: Mon Jun 27 13:38:55 2022 -0700
ibusManager: Avoid double fork triggering parent death in ibus
Use DO_NOT_REAP_CHILD to avoid a double-fork internally since ibus-daemon
refuses to start with init as its parent.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2345>
js/misc/ibusManager.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/js/misc/ibusManager.js b/js/misc/ibusManager.js
index 420459b769..8bcfb36741 100644
--- a/js/misc/ibusManager.js
+++ b/js/misc/ibusManager.js
@@ -109,9 +109,11 @@ var IBusManager = class {
this._tryAppendEnv(env, 'COMPOSE_FILE');
this._tryAppendEnv(env, 'DISPLAY');
- GLib.spawn_async(
+ // Use DO_NOT_REAP_CHILD to avoid adouble-fork internally
+ // since ibus-daemon refuses to start with init as its parent.
+ const [success_, pid] = GLib.spawn_async(
null, cmdLine, env,
- GLib.SpawnFlags.SEARCH_PATH,
+ GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
() => {
try {
global.context.restore_rlimit_nofile();
@@ -119,6 +121,11 @@ var IBusManager = class {
}
}
);
+ GLib.child_watch_add(
+ GLib.PRIORITY_DEFAULT,
+ pid,
+ () => GLib.spawn_close_pid(pid)
+ );
} catch (e) {
log(`Failed to launch ibus-daemon: ${e.message}`);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]