Hi all,
I’m facing an issue with location services provided by GeoClue.
My Qt app uses positionSource
to get GPS data. The GPS hardware is working correctly via gps-share
, and geoclue-agent
is working well too. However, the location only works if I launch my Qt app after both gps-share
and geoclue-agent
are already running.
The problem is: I’m launching my Qt app very early in the boot process using a script (even before systemd
), so I cannot simply “launch it after” these services. Unfortunately, when the app starts first, it fails to get location updates and never catches up, even after GeoClue and gps-share are ready.
I tried handling this on the Qt side by checking availability and retrying startUpdates()
later, but it doesn’t resolve the issue. The app seems unable to reconnect or get notified once GeoClue becomes ready.
My questions are:
- Is there an environment variable or D-Bus-related config I can set to link my Qt app with GeoClue regardless of start order?
- Can I reliably start
gps-share
andgeoclue-agent
earlier (before my app) within the script? - Or, is there a qt-based way to ensure my app waits for GeoClue and gps-share to be fully initialized
NB: as i said my qt app isn’t launched with a service but with a script and a a kernel command line init=/home/root/launch.sh
#!/bin/sh
# Mount essential filesystems
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
# Kernel modules
# Qt environment
# Start application
# Optionally replace script with systemd if needed
exec /lib/systemd/systemd
and yes i also tried this export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket and didn’t work
so currently i am trying to launch gps-share and geoclue agent in the same script if you have any idea how to do so