x11VNC 有关闭/重启命令吗?- Linux (Debian)

syn*_*sis 5 shutdown debian display x11vnc

我正在运行 Linux (Debian)。我最近在我的电脑上安装了 x11VNC 服务器。我发现启动服务器的命令是:

x11vnc -display :0
Run Code Online (Sandbox Code Playgroud)

我一直在搜索,但没有找到有关如何重新启动和关闭 x11VNC 服务器的任何信息。是否有执行此操作的命令?

ted*_*ted 13

既然你知道如何启动服务器,这里有一种优雅地停止它的方法:

x11vnc -R stop
Run Code Online (Sandbox Code Playgroud)

基本上,您向-remote正在运行的实例发送一个远程命令(请参阅 参考资料)。


slm*_*slm 5

如果您正在使用,systemd您应该能够将其设置为服务。我发现这个线程显示了设置x11vnc为 Systemd 服务的类似任务。该线程的标题为:索引»新手角»如何在启动时使用 systemd 启用 x11vnc?.

来自该线程的评论

  1. 创建文件: /etc/systemd/system/x11vnc.service

    [Unit]
    Description=VNC Server for X11
    Requires=display-manager.service
    After=display-manager.service
    
    [Service]
    Type=forking
    ExecStart=/usr/bin/x11vnc -norc -forever -shared -bg -rfbauth /etc/x11vnc.pass -allow 192.168.1. -autoport 5900 -o /var/log/x11vnc.log
    
    Run Code Online (Sandbox Code Playgroud)
  2. 创建文件: /etc/systemd/system/graphical.target

    #  This file is part of systemd.
    #
    #  systemd is free software; you can redistribute it and/or modify it
    #  under the terms of the GNU Lesser General Public License as published by
    #  the Free Software Foundation; either version 2.1 of the License, or
    #  (at your option) any later version.
    
    [Unit]
    Description=Graphical Interface
    Documentation=man:systemd.special(7)
    Requires=multi-user.target
    After=multi-user.target
    Conflicts=rescue.target
    Wants=display-manager.service
    Wants=x11vnc.service
    AllowIsolate=yes
    
    [Install]
    Alias=default.target
    
    Run Code Online (Sandbox Code Playgroud)
  3. 启用 Systemd 服务

    $ sudo systemctl enable graphical.target
    
    Run Code Online (Sandbox Code Playgroud)

    这应该创建一个这样的链接:

    /etc/systemd/system/default.target -> /etc/systemd/system/graphical.target

  4. 重启