zee*_*ena 5 arch-linux x11 systemd x11vnc
我在我的远程 PC 上使用 archlinux 版本 3.10.27-1-ARCH,我希望它在成功启动时启动 x11vnc 服务器。虽然我可以手动启动 x11vnc 服务器,但我无法自动启动它。的配置/etc/systemd/system/x11vnc.service如下
[Unit]
Description=VNC Server for X11
Requires=graphical.target
After=graphical.target
[Service]
ExecStart=/usr/bin/x11vnc -display :0 -nopw
Run Code Online (Sandbox Code Playgroud)
systemctl status x11vnc
x11vnc.service - VNC Server for X11
Loaded: loaded (/etc/systemd/system/x11vnc.service; enabled)
Active: inactive (dead)
Run Code Online (Sandbox Code Playgroud)
dmesg|grep x11vnc
[ 5.467201] systemd[1]: Found dependency on x11vnc.service/start
[ 5.467285] systemd[1]: Breaking ordering cycle by deleting job x11vnc.service/start
[ 5.467335] systemd[1]: Job x11vnc.service/start deleted to break ordering cycle starting with graphical.target/start
Run Code Online (Sandbox Code Playgroud)
我确实从dmesg输出中感觉到存在循环依赖,但我无法理解是什么。
我发现这个线程显示了类似的设置x11vnc为 Systemd 服务的任务。该线程的标题为:Index\xc2\xbb Newbie Corner\xc2\xbb 如何使用 systemd 在启动时启用 x11vnc ?。
来自该线程中的评论
\n\n创建文件:/etc/systemd/system/x11vnc.service
[Unit]\nDescription=VNC Server for X11\nRequires=display-manager.service\nAfter=display-manager.service\n\n[Service]\nType=forking\nExecStart=/usr/bin/x11vnc -norc -forever -shared -bg -rfbauth /etc/x11vnc.pass -allow 192.168.1. -autoport 5900 -o /var/log/x11vnc.log\nRun Code Online (Sandbox Code Playgroud)创建文件:/etc/systemd/system/graphical.target
# This file is part of systemd.\n#\n# systemd is free software; you can redistribute it and/or modify it\n# under the terms of the GNU Lesser General Public License as published by\n# the Free Software Foundation; either version 2.1 of the License, or\n# (at your option) any later version.\n\n[Unit]\nDescription=Graphical Interface\nDocumentation=man:systemd.special(7)\nRequires=multi-user.target\nAfter=multi-user.target\nConflicts=rescue.target\nWants=display-manager.service\nWants=x11vnc.service\nAllowIsolate=yes\n\n[Install]\nAlias=default.target\nRun Code Online (Sandbox Code Playgroud)启用Systemd服务
\n\n$ sudo systemctl enable graphical.target\nRun Code Online (Sandbox Code Playgroud)\n\n这应该创建一个像这样的链接:
\n\n\n/etc/systemd/system/default.target -> /etc/systemd/system/graphical.target
\n
重启
| 归档时间: |
|
| 查看次数: |
10695 次 |
| 最近记录: |