debian rustdesk-server 开机自启动

  1. clone rustdesk-server-demo https://github.com/rustdesk/rustdesk-server-demo.git
  2. 提前编译好 cargo build
  3. 写一个脚本 run_rustserver.sh ,内容如下:
    IP=192.168.50.77 /home/ling/code/rustdesk-server-demo/target/debug/rustdesk-server
  4. /etc/systemd/system下,创建一个rustdesk-server.service 文件,内容如下:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    [Unit]
    Description=Rust Server

    [Service]
    Type=simple
    ExecStart=/bin/bash /home/ling/run_rustserver.sh

    [Install]
    WantedBy=multi-user.target
  5. chmod 0644 rustdesk-server.service
  6. systemctl enable rustdesk-server.service

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!