From b6b9b5de46283f1fb202c19094cbff53d1369216 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Fri, 28 Aug 2020 11:00:39 +0200 Subject: [PATCH] fix(linux): Improve robustness when installing ibus-keyman If for whatever reason ibus wasn't running for the current user the installation failed previously, leaving the user in a broken state until he reboots and tries the installation again. This change detects this situation and skips restarting ibus. --- linux/ibus-keyman/debian/postinst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/linux/ibus-keyman/debian/postinst b/linux/ibus-keyman/debian/postinst index c1da17a98d..ed549823c7 100644 --- a/linux/ibus-keyman/debian/postinst +++ b/linux/ibus-keyman/debian/postinst @@ -14,10 +14,14 @@ case "$1" in if [ "x$gspid" != "x" ]; then # gnome-shell has multiple ibus-daemon processes and needs exit instead of restart ibususer=`ps -C ibus-daemon -o user=|grep -v gdm|uniq` - sudo -H -u "$ibususer" ibus exit + if [ "x$ibususer" != "x" ]; then + sudo -H -u "$ibususer" ibus exit + fi else ibususer=`ps -C ibus-daemon -o user=|uniq` - sudo -H -u "$ibususer" ibus restart + if [ "x$ibususer" != "x" ]; then + sudo -H -u "$ibususer" ibus restart + fi fi fi ;;