【问题标题】:xflux and systemd on Debian jessieDebian jessie 上的 xflux 和 systemd
【发布时间】:2016-06-24 12:34:16
【问题描述】:

我正在尝试将 xflux 添加为 systemd 服务,以便它在启动时启动,但是当我使用时

# systemctl start xflux.service 

它无法启动。我的 xflux.service 单元如下所示:

[Unit]
Description=xflux loader
After=display-manager.service

[Service]
Type=forking
ExecStart=/usr/bin/xflux -l 17
Restart=always

[Install]
WantedBy=graphical.target

我尝试过以各种方式表达 ExecStart,例如

ExecStart=/bin/sh -c "/usr/bin/xflux -l 17"

ExecStart=/usr/bin/start-xflux

'start-flux' 是一个带有一行的 sh 脚本:

exec /usr/bin/xflux -l 17 

没有任何效果。我总是从“systemctl status”得到相同的提示:

● xflux.service - xflux loader
   Loaded: loaded (/etc/systemd/system/xflux.service; enabled)
   Active: failed (Result: start-limit) since śro 2016-03-09 21:53:47 CET; 43min ago
 Main PID: 4409 (code=exited, status=255)

mar 09 21:53:47 debian systemd[1]: Unit xflux.service entered failed state.
mar 09 21:53:47 debian xflux[4561]: [10B blob data]
mar 09 21:53:47 debian xflux[4561]: --------
mar 09 21:53:47 debian xflux[4561]: Welcome to xflux (f.lux for X)
mar 09 21:53:47 debian xflux[4561]: This will only work if you're running X on console.
mar 09 21:53:47 debian xflux[4561]: Guessing your longitude is 15.0 based on your timezone
mar 09 21:53:47 debian xflux[4561]: Specify it with -g to make things better.
mar 09 21:53:47 debian systemd[1]: xflux.service start request repeated too quickly, refusing to start.
mar 09 21:53:47 debian systemd[1]: Failed to start xflux loader.
mar 09 21:53:47 debian systemd[1]: Unit xflux.service entered failed state.

我也试过auto-xflux - 没有成功。我显然不了解 xflux(“https://github.com/jamesan/auto-xflux”提示是什么意思?)或 systemd。 我还应该添加调用

$ xflux -l 17

从终端工作得很好。

你能帮忙吗?

【问题讨论】:

    标签: debian x11 kde systemd


    【解决方案1】:

    你可能需要添加

    [Service] 
    Environment=DISPLAY=:0
    

    (或者无论你的DISPLAY 号码是什么,在X 会话下运行的shell 中使用echo $DISPLAY 检查它)。此外,您可能希望在 systemd 的用户实例而不是系统实例下运行它,即使用 systemctl --user start xflux.service 并将单元放入 ~/.config/systemd/user/xflux.service

    https://wiki.archlinux.org/index.php/Systemd/User#DISPLAY_and_XAUTHORITY

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-26
      • 1970-01-01
      • 1970-01-01
      • 2016-06-07
      • 2016-12-08
      相关资源
      最近更新 更多