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

bash script running on websocketd can't connect to dbus #437

Open
baoheping opened this issue Feb 19, 2023 · 3 comments
Open

bash script running on websocketd can't connect to dbus #437

baoheping opened this issue Feb 19, 2023 · 3 comments

Comments

@baoheping
Copy link

baoheping commented Feb 19, 2023

In my bash script i called a command fcitx5-remote for switching input method, the command needs connect to dbus for calling fcitx5 interface. Then when i run this script in websocketd services, it's reporting error 'what(): Failed to create dbus connection' in log. When printing dbus environment variables in the script, it's all empty.

So is there a solution make enable commands running on websocketd could connect to dbus.

@baoheping baoheping changed the title bash scrip running in websocketd can't connect to dbus bash script running in websocketd can't connect to dbus Feb 19, 2023
@baoheping baoheping changed the title bash script running in websocketd can't connect to dbus bash script running on websocketd can't connect to dbus Feb 19, 2023
@PerMildner
Copy link

You say "environment variable sin the script, it's all empty". Have you looked at the --passenv option?

I know nothing about dbus, but many things get confused if their expected environment variables are absent.

@matvore
Copy link

matvore commented Feb 19, 2023

--passenv does not work for CGI scripts (for websocket processes it works as expected). This appears to be unintentional, as the code to make it work is written except only missing this trivial fix: matvore@cd87527

@baoheping
Copy link
Author

Thanks to @PerMildner , after --passenv DBUS_SESSION_BUS_ADDRESS,XDG_RUNTIME_DIR, it's working fine.

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

No branches or pull requests

3 participants