From 12aa2293c400697ed9edce3726300a195f48188d Mon Sep 17 00:00:00 2001 From: teatower <41335248+teatower@users.noreply.github.com> Date: Sat, 17 Jun 2023 17:59:53 +0200 Subject: [PATCH] DBus exception when calling dbus-send via Cron under Ubuntu --- DBus-service.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DBus-service.md b/DBus-service.md index b41ec77..075c0ff 100644 --- a/DBus-service.md +++ b/DBus-service.md @@ -222,3 +222,10 @@ Environment variable `DBUS_SESSION_BUS_ADDRESS` needs to be set. See [#394](http Under Mac OSX, the environment variable `DBUS_LAUNCHD_SESSION_BUS_SOCKET` needs to be set (see above). This can be done by issuing the command ```export DBUS_LAUNCHD_SESSION_BUS_SOCKET=$(launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET)``` + +#### DBus exception when calling dbus-send via Cron under Ubuntu + Failed to open connection to "session" message bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 + +Script started via Cron must export environment variable `DBUS_SESSION_BUS_ADDRESS` before calling dbus-send + +```export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus``` \ No newline at end of file