x11vnc 在 15.10 中运行良好,但升级后无法在启动时运行
尝试从终端手动运行:
$ /usr/bin/x11vnc -auth /var/run/sddm/:0 -forever -loop -noxdamage -repeat -rfbauth /home/user/.vnc/passwd -rfbport 5900 -shared > /dev/null 2>&1 &
工作正常!!
但使用时却sudo
不行:
$ sudo /usr/bin/x11vnc -auth /var/run/sddm/:0 -forever -loop -noxdamage -repeat -rfbauth /home/user/.vnc/passwd -rfbport 5900 -shared
--- x11vnc loop: 1 ---
--- x11vnc loop: waiting for: 12140
25/04/2016 10:36:39 passing arg to libvncserver: -rfbauth
25/04/2016 10:36:39 passing arg to libvncserver: /home/user/.vnc/passwd
25/04/2016 10:36:39 passing arg to libvncserver: -rfbport
25/04/2016 10:36:39 passing arg to libvncserver: 5900
25/04/2016 10:36:39 x11vnc version: 0.9.13 lastmod: 2011-08-10 pid: 12140
No protocol specified
25/04/2016 10:36:39 XOpenDisplay(":0") failed.
25/04/2016 10:36:39 Trying again with XAUTHLOCALHOSTNAME=localhost ...
No protocol specified
25/04/2016 10:36:39 ***************************************
25/04/2016 10:36:39 *** XOpenDisplay failed (:0)
所以我猜测这与运行级别有关,但我不是专家,需要一些线索来解决它。
我的/lib/systemd/system/x11vnc.service
样子如下:
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth /var/run/sddm/:0 -forever -loop -noxdamage -repeat -rfbauth /home/user/.vnc/passwd -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
w
或命令都ps wwwwaux | grep auth
告诉我显示静止:0
(这当然是有道理的,因为它可以在没有 的情况下工作sudo
)
任何帮助,将不胜感激