ibus very difficult to restart

Bug #1922186 reported by DarkTrick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ibus
New
Unknown
ibus (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

After closing ibus by task bar -> icon -> rightclick -> `Close` it seems to be impossible to restart it.

Here some ways that should work and how they fail:

1) Menu -> ibus
-----------------
- opens iBus settings
- starts ibus service

Problems:
  - No keyboard input is actually processed; I.e. cannot use keyboard then.
  - Service is not daemonized; I.e. as soon as the iBus settings window is closed, the services quits.

Suggestion:
  - No keyboard input possible seems to be a bug -> should be fixed.
  - Service should be daemonized at this point

2) terminal -> `ibus start`
---------------------------
Problems:
  - This command does not exist. One has to know, that `ibus-daemon` is the one they are searching for.

Suggestions:
  - Implement this command to start the daemon from here

3) terminal -> `ibus-daemon &` / `ibus-daemon -d`
-------------------------------------------------
 - brings up ibus with usable keyboard (good)

Problems:
  - As soon as terminal gets closed, ibus-daemon quits

4) terminal -> `nohup ibus-daemon &`
-------------------------------------------------
 - brings up ibus with usable keyboard (good)

Problem:
  - As soon as terminal gets closed, ibus-daemon quits (very strange. something I wouldn't expect from a `nohup` call, by the way).

System
=======

- I use ibus in conjunction with ibus-anthy

lsb_release -rd
----------------------
Description: Ubuntu 20.10
Release: 20.10

apt-cache policy ibus
----------------------
ibus:
  Installed: 1.5.23-0ubuntu1
  Candidate: 1.5.23-0ubuntu1
  Version table:
 *** 1.5.23-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu groovy/main amd64 Packages
        100 /var/lib/dpkg/status

apt-cache policy ibus-anthy
----------------------
ibus-anthy:
  Installed: 1.5.11-1build1
  Candidate: 1.5.11-1build1
  Version table:
 *** 1.5.11-1build1 500
        500 http://archive.ubuntu.com/ubuntu groovy/universe amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: ibus 1.5.23-0ubuntu1
ProcVersionSignature: Ubuntu 5.8.0-45.51-generic 5.8.18
Uname: Linux 5.8.0-45-generic x86_64
ApportVersion: 2.20.11-0ubuntu50.5
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: XFCE
Date: Thu Apr 1 15:33:00 2021
RebootRequiredPkgs:
 linux-image-5.8.0-48-generic
 linux-base
 linux-image-5.8.0-49-generic
 linux-base
SourcePackage: ibus
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
DarkTrick (darktrick1337) wrote :
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

It's not clear to me why you would want to kill the ibus-daemon process in the first place. It's setup (via im-config) to be started and configured at login.

As regards commands to start ibus from terminal it differs depending on the desktop environment.

GNOME:
ibus-daemon --panel disable --xim -d

Other desktop environments:
ibus-daemon --xim -d

In situations where ibus crashes somehow, and IM inputting stops working, you normally can do:

ibus restart

to fix it.

Changed in ibus (Ubuntu):
status: New → Incomplete
Revision history for this message
DarkTrick (darktrick1337) wrote :

> It's not clear to me why you would want to kill the ibus-daemon process in the first place

I would say that's no valid argument because:
1) It has a "Quit" option. If you should not quit it, there should be no "Quit" option in the menu.
2) ibus is not system critical. Non-system critical processes should be restartable

> it differs depending on the desktop environment.
I appreciate the commands, but why should I as user need to care about that?

> In situations where ibus crashes somehow, and IM inputting stops working, you normally can do:
> ibus restart

1) I did not have crashes since 20.04. However, in crashes in 18.xx I remember that `ibus restart` would simply tell me "there is no running instance" and do nothing.
2) Why can't this happen, when I call ibus from application menu?

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

On 2021-04-01 16:23, DarkTrick wrote:
> 1) It has a "Quit" option. If you should not quit it, there should be
> no "Quit" option in the menu.

That confuses me. I see that you use an XFCE desktop, and the only icon you should have AFAIK is "IBus Preferences" which starts a GUI for certain settings. Quitting that should only quit "IBus Preferences" while ibus-daemon should keep running.

If you have something else, can you please take a screenshot to show us what it looks like.

ibus-daemon is not an application. It's a background process, and on Debian/Ubuntu it's started silently at login while a few related environment variables are set.

If you want to use some other IM framework, e.g. Fcitx or uim, you can tell the system so in "Language Support", and after next reboot it will start Fcitx or uim at login instead and assign other values to the related variables.

> However, in crashes in 18.xx I remember that `ibus restart` would
> simply tell me "there is no running instance" and do nothing.

Right, if the ibus-daemon process is not running, "ibus restart" won't help. But there are 'crashes' which don't kill ibus-daemon, and then "ibus restart" often helps.

Revision history for this message
DarkTrick (darktrick1337) wrote :

This is the icon I have in my task bar.

Right clicking opens a menu with:
- Preferences
- Emoji Choice
- About
- Restart
- Quit

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for clarifying; now I understand better. Yes, there typically is an ibus icon when you use ibus on a non-GNOME desktop (which I don't very often). And it indeed includes a "Quit" option.

When the daemon is started from IBus Preferences, I agree it should be daemonized so it's not killed when you close IBus Preferences. I reported that upstream, and if you want to test the proposed fix in hirsute, you can install the ibus packages from this PPA:

https://launchpad.net/~gunnarhj/+archive/ubuntu/ibus

I'm not able to reproduce the other issues you mention, though.

Changed in ibus (Ubuntu):
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
DarkTrick (darktrick1337) wrote :

Awesome! Thank you very much for reporting upstream!

I'll try to test it as soon as hirusute is available and report back!

Changed in ibus:
status: Unknown → New
Revision history for this message
DarkTrick (darktrick1337) wrote :

+ Added the PPA and installed, now ibus stays "on" after openning the dialog. 👍️
- `ibus restart` still doesnt work: "Can't connect to IBus"

Would be nice to also have a cmd-line option working for this case.

FYI:
Btw: here's another reason for quitting/restarting ibus: if I call `killall python3` on my machine, ibus/anthy (?) seems to get into an inconsistent state, which prevents input on certain apps. I guess the reason for this is somehow connected to what I've described earlier.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Hey, how about getting a more constructive hobby than killing various important processes on your system? ;)

More seriously: I'm not sure that "ibus restart" is intended to handle such situations. But please feel free to comment on the issue I submitted — the upstream maintainer hasn't attended to it yet. Or, probably better, submit an own upstream issue since they are separate things.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

The behavior when starting ibus-daemon from IBus Preferences was fixed in ibus 1.5.25-2.

Changed in ibus (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.