diff options
| author | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-10 17:45:11 +0800 |
|---|---|---|
| committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-10 17:45:11 +0800 |
| commit | e5d5a690e8c846ce8f6ff3bd110b9cb210cf8881 (patch) | |
| tree | 06dd725a42081a5b681582e8fa548f4c5ee77bee /launcher | |
| parent | 643ea31cccee823c7e9e1021fca142b3825f9d8f (diff) | |
| download | ibus-e5d5a690e8c846ce8f6ff3bd110b9cb210cf8881.tar.gz ibus-e5d5a690e8c846ce8f6ff3bd110b9cb210cf8881.tar.xz ibus-e5d5a690e8c846ce8f6ff3bd110b9cb210cf8881.zip | |
use spaw replace fork.
Diffstat (limited to 'launcher')
| -rw-r--r-- | launcher/ibus.in | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/launcher/ibus.in b/launcher/ibus.in index 82c1ac4..33baa94 100644 --- a/launcher/ibus.in +++ b/launcher/ibus.in @@ -24,19 +24,38 @@ import time daemon = "@prefix@/libexec/ibus-daemon" panel = "@prefix@/libexec/ibus-panel" +conf = "@prefix@/libexec/ibus-gconf" -pid = os.fork () -if pid > 0: # parent +daemon_pid = 0 + +try: print "start ibus-daemon" - os.execv (daemon, [daemon]) + daemon_pid = os.spawnv (os.P_NOWAIT, daemon, [daemon]) +except: print >> sys.stderr, "start ibus-daemon failed" sys.exit (1) -elif pid == 0: - time.sleep (1) + +time.sleep (1) + +try: print "start ibus-panel" - os.execv (panel, [panel]) + os.spawnv (os.P_NOWAIT, panel, [panel]) +except: print >> sys.stderr, "start ibus-panel failed" sys.exit (1) -else: - print >> sys.stderr, "can not start ibus" + +try: + print "start ibus-conf" + os.spawnv (os.P_NOWAIT, conf, [conf]) +except: + print >> sys.stderr, "start ibus-conf failed" + sys.exit (1) + +try: + os.kill (daemon_pid, 0) +except: sys.exit (1) + +os.waitpid (daemon_pid, 0) + +os.wait (daemon_pid) |
