一元网络论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 90|回复: 0

Service always goes down after running for several days. Why?

[复制链接]

3万

主题

3万

帖子

9万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
94972
发表于 2024-10-17 15:38:11 | 显示全部楼层 |阅读模式
Because the small chickens were not good at pulling mirrors, we directly started the rustdesk service in script form.


This is the script, chmod +x to give it permission:



[ol]
  • #!/bin/sh
  • workdir=$(dirname "$0")
  • cd $workdir
  • nohup $workdir/hbbs -k _ >> $workdir/nohup.out 2>&1 &
  • nohup $workdir/hbbr -k _ >> $workdir/nohup.out 2>&1 &
  • exit 0[/ol]
    复制代码


    Then add startup, in etc/systemd/system/rustdesk-autostart.service



    [ol]
  • [Unit]
  • Description=rustdesk-autostart Server
  • After=network-online.target
  • [Service]
  • Type=simple
  • ExecStart=/root/rustdesk/rustdesk-start.sh
  • RemainAfterExit=yes
  • [Install]
  • WantedBy=multi-user.target[/ol]
    复制代码


    Then set boot up and start



    [ol]
  • systemctl enable rustdesk-autostart.service
  • systemctl daemon-reload
  • systemctl start rustdesk-autostart.service[/ol]
    复制代码



    But every week or so, ps -ef | grep hbb will not see the process, and rebooting is required for normal operation.

  • 回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|一元网络论坛

    GMT+8, 2024-11-24 09:16 , Processed in 0.086644 second(s), 19 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表