1 Linux系统如何设置后台运行&开机自启
Gui.H edited this page 2021-03-12 10:38:53 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

  1. 安装.net 5运行时环境, 文档:.net runtime install 执行 donet 判断否安装成功,安装成功后执行 whereis dotnet 获取执行文件所在位置,此路径通常为 /usr/share/dotnet/dotnet 下一步需要用到
  2. 编写service文件例如fasttunnel.service,根据自己的机器环境不同自行修改参数WorkingDirectory=xxxxxx ExecStart=xxxxxxx ExecReload=xxxxx等,其他参数不做介绍,不懂的可以百度 放置在linux目录/etc/systemd/system
  3. 执行配置开机自启命令 systemctl enable fasttunnel.service
  4. 执行启动服务命令 systemctl start fasttunnel.service