Skip to content
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

D-Bus Activation #457

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

D-Bus Activation #457

wants to merge 1 commit into from

Conversation

JoseExposito
Copy link
Owner

Trying to fix #456

@@ -0,0 +1,5 @@
[D-BUS Service]
Name=io.github.joseexposito.Touchegg
Exec=/usr/bin/touchegg --daemon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Exec=/usr/bin/touchegg --daemon
Exec=/bin/false

This will call the SystemdService

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for looking into this 😄 I tried that and there seems to be 2 major issues:

  • Installation from deb package hangs until the service times out, even thought the service is running in the background
  • The service stars even when no clients are connected and crashes every 2 minutes:
Feb 20 12:14:57 elementary-os systemd[1]: touchegg.service: start operation timed out. Terminating.
Feb 20 12:14:58 elementary-os systemd[1]: touchegg.service: Failed with result 'timeout'.
Feb 20 12:14:58 elementary-os systemd[1]: Failed to start Touchégg Daemon.

It seems like the service is not waiting for the creation of the D-Bus interface even with /bin/false 🤔

@decathorpe
Copy link

Fedora has some documentation for creating DBus-activated systemd services here, maybe it helps:
https://fedoraproject.org/wiki/Packaging:Systemd#DBus_activation

@davidmhewitt
Copy link

I'm not 100% sure but I think the issues here are because touchégg doesn't run on the DBus bus. It's creates a UNIX socket that the clients connect to and uses the DBus protocol over that.

So systemd probably can't recognise that a client is connecting and activate the service as a result.

This would actually need to be more like a socket activated service which is also possible with systemd. But... The server needs to be able to take the file descriptor of the socket that systemd has created and passed on startup and use that instead of creating a new socket. I can't see a way to do that with the GLib DBus libraries used here.

@JoseExposito
Copy link
Owner Author

I think that's probably the reason @davidmhewitt. I didn't test it, but I'm sure that moving the connection to the system or session bus will solve it.

Ideally we should keep the UNIX socket for a while for backwards compatibility... I just wasn't motivated to do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow touchegg to be run by systemd on-request
4 participants