admin 发表于 2024-10-17 15:38:11

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

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:




[*]#!/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
复制代码


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




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


Then set boot up and start




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



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

页: [1]
查看完整版本: Service always goes down after running for several days. Why?