Arch-Linux

不允許使用 GeoClue2 的 Redshift 使用者服務

  • October 23, 2018

我無法讓 Redshift 從 GeoClue2 檢索地理位置資訊。現在的狀態,在重新啟動後並且自重新啟動後沒有更改任何包或配置,是

  • GeoClue 服務正在執行:
$ systemctl status geoclue.service
● geoclue.service - Location Lookup Service
  Loaded: loaded (/usr/lib/systemd/system/geoclue.service; static; vendor preset: disabled)
  Active: active (running) since Wed 2018-09-05 18:49:03 NZST; 3s ago
Main PID: 8489 (geoclue)
   Tasks: 4 (limit: 4915)
  Memory: 2.1M
  CGroup: /system.slice/geoclue.service
          └─8489 /usr/lib/geoclue

Sep 05 18:49:03 machine systemd[1]: Starting Location Lookup Service...
Sep 05 18:49:03 machine systemd[1]: Started Location Lookup Service.
  • 軟體包是最新的:
$ pacman --sync --info geoclue2 redshift
Repository      : extra
Name            : geoclue2
Version         : 2.4.12-1
Description     : Modular geoinformation service built on the D-Bus messaging system
Architecture    : x86_64
URL             : https://www.freedesktop.org/wiki/Software/GeoClue/
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : libsoup  json-glib  libmm-glib  avahi  libnotify
Optional Deps   : None
Conflicts With  : geoclue
Replaces        : None
Download Size   : 154.42 KiB
Installed Size  : 1206.00 KiB
Packager        : Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Build Date      : Sun 02 Sep 2018 07:42:59 NZST
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Repository      : community
Name            : redshift
Version         : 1.12-2
Description     : Adjusts the color temperature of your screen according to your surroundings.
Architecture    : x86_64
URL             : http://jonls.dk/redshift/
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : geoclue2  libdrm  libxcb  libxxf86vm
Optional Deps   : python-gobject: for redshift-gtk
                 python-xdg: for redshift-gtk
                 gtk3: for redshift-gtk
Conflicts With  : None
Replaces        : None
Download Size   : 130.88 KiB
Installed Size  : 851.00 KiB
Packager        : Evangelos Foutras <evangelos@foutrelis.com>
Build Date      : Tue 24 Jul 2018 03:19:05 NZST
Validated By    : MD5 Sum  SHA-256 Sum  Signature
  • GeoClue 配置為允許從 Redshift 訪問:
$ tail --lines=4 /etc/geoclue/geoclue.conf
[redshift]
allowed=true
system=false
users=

然而 Redshift 無法啟動:

$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.
Waiting for initial location to become available...
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying.
Unable to get location from provider.

使用者服務表現出不同的行為:

Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.
Waiting for initial location to become available...
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 1000.
Access to the current location was denied by GeoClue!
Make sure that location services are enabled and that Redshift is permitted
to use location services. See https://github.com/jonls/redshift#faq for more
information.
Unable to get location from provider.

似乎有一個黑客可以解決類似的問題——上面的錯誤消息與手動啟動程序時的那個頁面不同——但我對是否有更永久的修復程序可用或正在處理感興趣。

這是 GeoClue 程序中的一個已知問題,但已在 2.5.0 版中修復。升級到該版本應該可以解決您的問題。

引用自:https://unix.stackexchange.com/questions/466936