On Sun, 27 Dec 2020 16:41:54 +0100, Laurent Bigonville wrote: > > And that's it. So "something" (with system apps? or accuracy level? > > or something else?) changed which breaks how at least for me geoclue > > has worked for a couple of years. > I reintroduced a delay where the geoclue daemon will wait for the agent to > appear on the Bus if the daemon is D-Bus activated. The timeout is "dumb" > and will always wait 20s even if the agent appears earlier. The timeout for > the client should be 30s. > Can you try to start (systemctl start geoclue) the daemon before running > "where-am-i" so the agent will be connected before the 1st location request > comes in?
Not easily in this way, as I don't have systemctl/systemd on this
machine.
(Apart from manual invocation like `G_MESSAGES_DEBUG=all runuser -u
geoclue -- /usr/libexec/geoclue', I've written a quick init script;
attached, in case it's of interest for others.)
> If the problem was the accuracy, the client would get an AccessDenied or
> something like that.
Right.
> I just retried again in my GNOME session (so gnome-shell is acting as the
> agent) and with the demo agent in a terminal and both are working fine, so
> I'm not too sure what's happening...
One additional observation: With 2.5.6-1, I can
* start with no geoclue-daemon and no demo-agent running
* call where-am-i (or redshift -p)
* and get a result (plus a running daemon)
> Can you try to modify the geoclue.service file and add
> Environment=G_MESSAGES_DEBUG=all to the [Service] section (and then run
> systemctl daemon-reload)? That should increase the logs of the daemon
Ok, so let's try again:
- Upgrade the geoclue packages to 2.5.7-1.
- Accept the new config (plus the redshift stanza).
- Make sure no geoclue-daemon, geoclue-agent, or redshift is running.
- Start the daemon.
Output at this time:
(geoclue:22572): Geoclue-DEBUG: 16:10:25.084: Failed to get config "wifi/url":
Key file does not have key “url” in group “wifi”
(geoclue:22572): Geoclue-DEBUG: 16:10:25.084: Failed to get config
"wifi/submission-url": Key file does not have key “submission-url” in group
“wifi”
(geoclue:22572): GLib-GIO-DEBUG: 16:10:25.095: Failed to initialize portal
(GNetworkMonitorPortal) for gio-network-monitor: Not using portals
(geoclue:22572): GLib-GIO-DEBUG: 16:10:25.096: Failed to initialize
networkmanager (GNetworkMonitorNM) for gio-network-monitor: NetworkManager not
running
(geoclue:22572): GLib-GIO-DEBUG: 16:10:25.096: _g_io_module_get_default: Found
default implementation netlink (GNetworkMonitorNetlink) for
‘gio-network-monitor’
(geoclue:22572): Geoclue-DEBUG: 16:10:25.097: Available accuracy level from
GClueWifi: 4
(geoclue:22572): Geoclue-WARNING **: 16:10:25.107: Failed to connect to avahi
service: Daemon not running
- Check that the daemon is running, wait a minute or three.
- Start demo-agent.
- Meanwhile the daemon said:
Geoclue-Message: 16:11:25.043: Service not used for 60 seconds. Shutting down..
(geoclue:22572): Geoclue-DEBUG: 16:11:25.043: GClueWifi already inactive, not
stopping.
(geoclue:22572): Geoclue-DEBUG: 16:11:25.044: GClue3G already inactive, not
stopping.
(geoclue:22572): Geoclue-DEBUG: 16:11:25.044: GClueCDMA already inactive, not
stopping.
(geoclue:22572): Geoclue-DEBUG: 16:11:25.044: GClueModemGPS already inactive,
not stopping.
(geoclue:22572): Geoclue-DEBUG: 16:11:25.044: GClueNMEASource already inactive,
not stopping.
(geoclue:22572): Geoclue-DEBUG: 16:11:25.044: GClueLocator already inactive,
not stopping.
- And no more daemon in the process list, now just the demo-agent is
running.
- Kill demo-agent.
- Start the daemon (same output as before).
- Start the demo-agent 45 seconds later.
- daemon says:
(geoclue:31245): Geoclue-DEBUG: 16:17:48.887: New agent for user ID '1000'
- and then:
Geoclue-Message: 16:18:00.043: Service not used for 60 seconds. Shutting down..
(geoclue:31245): Geoclue-DEBUG: 16:18:00.044: GClueWifi already inactive, not
stopping.
(geoclue:31245): Geoclue-DEBUG: 16:18:00.044: GClue3G already inactive, not
stopping.
(geoclue:31245): Geoclue-DEBUG: 16:18:00.044: GClueCDMA already inactive, not
stopping.
(geoclue:31245): Geoclue-DEBUG: 16:18:00.044: GClueModemGPS already inactive,
not stopping.
(geoclue:31245): Geoclue-DEBUG: 16:18:00.045: GClueNMEASource already inactive,
not stopping.
(geoclue:31245): Geoclue-DEBUG: 16:18:00.045: GClueLocator already inactive,
not stopping.
- At this point (the agent is still running but) the daemon process
stopped.
- Next try: Start daemon, sleep 45 seconds, run where-am-i (with no
agent before).
- After the 45 seconds the daemon says:
(geoclue:5241): Geoclue-DEBUG: 16:22:31.260: Service now in use
(geoclue:5241): Geoclue-DEBUG: 16:22:31.260: Number of connected clients: 1
(geoclue:5241): Geoclue-DEBUG: 16:22:31.263: 'geoclue-where-am-i' not in
configuration
(geoclue:5241): Geoclue-DEBUG: 16:22:36.040: Client `:1.232` vanished. Dropping
associated client objects
(geoclue:5241): Geoclue-DEBUG: 16:22:36.040: Service not in use
(geoclue:5241): Geoclue-DEBUG: 16:22:36.040: Number of connected clients: 0
- and where-am-i says:
** (where-am-i:6082): CRITICAL **: 16:22:36.038: Failed to connect to GeoClue2
service: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied:
'geoclue-where-am-i' disallowed, no agent for UID 1000
- But the daemon is still running. And stops a bit later with the
"Service not used" message.
- Next try: start daemon, sleep 25 seconds, start agent, run
where-ami-i. - daemon says:
(geoclue:10479): Geoclue-DEBUG: 16:26:31.618: New agent for user ID '1000'
(geoclue:10479): Geoclue-DEBUG: 16:26:35.094: Service now in use
(geoclue:10479): Geoclue-DEBUG: 16:26:35.094: Number of connected clients: 1
(geoclue:10479): Geoclue-DEBUG: 16:26:35.097: 'geoclue-where-am-i' not in
configuration
(geoclue:10479): Geoclue-DEBUG: 16:26:35.097: requested accuracy level: 8. Max
accuracy level allowed by agent: 8
(geoclue:10479): Geoclue-DEBUG: 16:26:35.097: 'geoclue-where-am-i' not in
configuration
(geoclue:10479): Geoclue-DEBUG: 16:26:35.097: GClueModemManager: New
time-threshold: 0
(geoclue:10479): Geoclue-DEBUG: 16:26:35.098: GClueLocator now active
(geoclue:10479): Geoclue-DEBUG: 16:26:35.098: GClueWifi now active
(geoclue:10479): Geoclue-DEBUG: 16:26:35.098: Network available
(geoclue:10479): Geoclue-WARNING **: 16:26:35.098: Failed to create query: No
WiFi devices available
(geoclue:10479): Geoclue-DEBUG: 16:26:35.098: Not starting GClue3G (accuracy
level: 0). Requested accuracy level: 8.
(geoclue:10479): Geoclue-DEBUG: 16:26:35.098: Not starting GClueCDMA (accuracy
level: 0). Requested accuracy level: 8.
(geoclue:10479): Geoclue-DEBUG: 16:26:35.098: Not starting GClueModemGPS
(accuracy level: 0). Requested accuracy level: 8.
(geoclue:10479): Geoclue-DEBUG: 16:26:35.098: Not starting GClueNMEASource
(accuracy level: 0). Requested accuracy level: 8.
(geoclue:10479): Geoclue-DEBUG: 16:26:35.098: 'geoclue-where-am-i' started.
(geoclue:10479): Geoclue-DEBUG: 16:26:35.100: Failed to claim IIO proxy
compass: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name
net.hadess.SensorProxy was not provided by any .service files
- where-am-i says:
Geolocation service in use
(timeout)
Geolocation service not in use
When I uncomment the url and submission-url in the conf file, the
complaints about them missing unsurprisingly go away, but the daemon
still complains about
(geoclue:15640): Geoclue-WARNING **: 16:30:06.911: Failed to create query: No
WiFi devices available
and shuts down 60 seconds after the last client (where-am-i)
connection.
And then I ran out of ideas and downgraded to the version in testing.
Sorry for this long description; maybe it gives you some ideas …
Happy to do other tests!
Cheers,
gregor
--
.''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
`-
#!/usr/bin/env /lib/init/init-d-script
### BEGIN INIT INFO
# Provides: geoclue
# Required-Start: $syslog $time $remote_fs dbus
# Required-Stop: $syslog $time $remote_fs dbus
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: GeoClue2 Location Lookup Service
# Description: Debian init script to start the GeoClue2 daemon.
### END INIT INFO
DAEMON=/usr/libexec/geoclue
DAEMON_USER=geoclue
START_ARGS="--background --make-pidfile --chuid $DAEMON_USER"
STOP_ARGS="--user $DAEMON_USER"
do_start_prepare() {
if [ "$DEBUG" = "true" ] ; then
export G_MESSAGES_DEBUG=all
START_ARGS="$START_ARGS --no-close"
fi
}
signature.asc
Description: Digital Signature

