New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(linux): Start dbus if not running #10863
Conversation
This change checks the DBus environment variables when initializing the `keyman_config` module and starts DBus if the variables are not set. This particularly happens when trying to install or uninstall a keyboard for a different user, which will now be possible with this change. Fixes #9363.
User Test ResultsTest specification and instructions
Test Artifacts |
logging.warning('Got unexpected line from dbus-launch: %s', line) | ||
continue | ||
name = line[:equal_sign] | ||
value = line[equal_sign+1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this empty if =
is at the end of the line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
When installing the packages for this PR on Focal it's no longer possible to type with Keyman. Most often the keyboards don't show up, and if they do typing doesn't work. |
Things work after rebooting after the installation. |
If we want to log messages we need to start DBus after we initialized logging.
GROUP_FOCAL:
|
Also need to start as daemon so that it works when run as a different user.
When we launch dbus if it is not running, we're probably (un-)installing keyboards for a different user. This is an unusual environment where not everything is available, e.g. dconf-service won't be running and can't be started because DISPLAY variable is not set. This means we can't write gsettings values through the API. However, we can read them, and we can write a keyfile and update the database. This is what this change implements for the cases where we started dbus.
`DBUS_SESSION_BUS_PID` gets only set when launching dbus in the process, but not when it's already running.
@bharanidharanj Could you please run the tests again? I had to change quite a bit. Thanks! Note that on Ubuntu 20.04 Focal you can ignore the "Unable to init server: Could not connect: Connection refused" message. @keymanapp-test-bot retest |
Changes in this pull request will be available for download in Keyman version 17.0.295-beta |
This change checks the DBus environment variables when initializing the
keyman_config
module and starts DBus if the variables are not set. This particularly happens when trying to install or uninstall a keyboard for a different user, which will now be possible with this change.Fixes #9363.
User Testing
Preparations
The tests should be run on these Linux platforms:
Install build artifacts of this PR
Reboot
Create a second user
myuser
without admin privilegesTests
TEST_INST: Can install a keyboard for the second user
myuser
by runningsu --login myuser
myuser
run:km-package-install -p sil_euro_latin --bcp47 de
myuser
TEST_UNINST: Can uninstall a keyboard for the second user
myuser
by runningsu --login myuser
myuser
run:km-package-uninstall sil_euro_latin
myuser