[GH-ISSUE #4521] frps如何设置开机自动启动? #3571

Closed
opened 2026-05-05 14:17:44 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @zql666999 on GitHub (Nov 1, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4521

Describe the feature request

frps每次开机以后,不能自动启动,已经设置过sytemctl enable frps还是不能开机自动启动,需要手动,要怎样才能自动启动?

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @zql666999 on GitHub (Nov 1, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4521 ### Describe the feature request frps每次开机以后,不能自动启动,已经设置过sytemctl enable frps还是不能开机自动启动,需要手动,要怎样才能自动启动? ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
Author
Owner

@phil616 commented on GitHub (Nov 3, 2024):

可能是你的service文件配置出现了问题,请提供您的配置文件或者可以尝试我在下面提供的

[Unit]
Description=frps service
After=network.target

[Service]
Type=simple
ExecStart=/root/frp/frps -c /root/frp/frps.toml
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

/root/frp/frps替换为执行文件的位置,/root/frp/frps.toml为配置文件的位置。
https://gofrp.org/zh-cn/docs/setup/systemd/ 这里有一些简略介绍。
也可能是SELinux的问题,请参考https://github.com/fatedier/frp/issues/4350
如果是其他诸如配置文件出错或是端口问题,在以往的issue中都有提到,可以尝试在这个仓库里直接搜索相关问题。

<!-- gh-comment-id:2453424193 --> @phil616 commented on GitHub (Nov 3, 2024): 可能是你的service文件配置出现了问题,请提供您的配置文件或者可以尝试我在下面提供的 ``` [Unit] Description=frps service After=network.target [Service] Type=simple ExecStart=/root/frp/frps -c /root/frp/frps.toml Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target ``` 将`/root/frp/frps`替换为执行文件的位置,/root/frp/frps.toml为配置文件的位置。 在https://gofrp.org/zh-cn/docs/setup/systemd/ 这里有一些简略介绍。 也可能是SELinux的问题,请参考https://github.com/fatedier/frp/issues/4350 如果是其他诸如配置文件出错或是端口问题,在以往的issue中都有提到,可以尝试在这个仓库里直接搜索相关问题。
Author
Owner

@zql666999 commented on GitHub (Nov 4, 2024):

可能是您的服务文件配置出现了问题,请提供您的配置文件或者可以尝试我在下面提供的

[Unit]
Description=frps service
After=network.target

[Service]
Type=simple
ExecStart=/root/frp/frps -c /root/frp/frps.toml
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

/root/frp/frps替换为执行文件的位置,/root/frp/frps.toml为配置文件的位置。 在https://gofrp.org/zh-cn/docs/setup/systemd/这里有一些简略介绍。 也可能是SELinux的问题,请参考#4350, 如果是其他此类配置文件异常或者端口问题,在以往的issue中都有提到,可以尝试在这个仓库里直接搜索相关问题。

你好 我的配置文件如下,请帮忙找找不能启动问题出在哪里,搞了好久都不能自动启动,搞不懂怎么回事了。

Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/frps
Description=LSB: starts the frps
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=all.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/frps start
ExecStop=/etc/init.d/frps stop

<!-- gh-comment-id:2454525526 --> @zql666999 commented on GitHub (Nov 4, 2024): > 可能是您的服务文件配置出现了问题,请提供您的配置文件或者可以尝试我在下面提供的 > > ``` > [Unit] > Description=frps service > After=network.target > > [Service] > Type=simple > ExecStart=/root/frp/frps -c /root/frp/frps.toml > Restart=on-failure > RestartSec=5s > > [Install] > WantedBy=multi-user.target > ``` > > 将`/root/frp/frps`替换为执行文件的位置,/root/frp/frps.toml为配置文件的位置。 在https://gofrp.org/zh-cn/docs/setup/systemd/这里有一些简略介绍。 也可能是SELinux的问题,请参考[#4350,](https://github.com/fatedier/frp/issues/4350) 如果是其他此类配置文件异常或者端口问题,在以往的issue中都有提到,可以尝试在这个仓库里直接搜索相关问题。 你好 我的配置文件如下,请帮忙找找不能启动问题出在哪里,搞了好久都不能自动启动,搞不懂怎么回事了。 # Automatically generated by systemd-sysv-generator [Unit] Documentation=man:systemd-sysv-generator(8) SourcePath=/etc/init.d/frps Description=LSB: starts the frps Before=multi-user.target Before=multi-user.target Before=multi-user.target Before=graphical.target After=all.target [Service] Type=forking Restart=no TimeoutSec=5min IgnoreSIGPIPE=no KillMode=process GuessMainPID=no RemainAfterExit=yes SuccessExitStatus=5 6 ExecStart=/etc/init.d/frps start ExecStop=/etc/init.d/frps stop
Author
Owner

@phil616 commented on GitHub (Nov 4, 2024):

可能是您的服务文件配置出现了问题,请提供您的配置文件或者可以尝试我在下面提供的

[Unit]
Description=frps service
After=network.target

[Service]
Type=simple
ExecStart=/root/frp/frps -c /root/frp/frps.toml
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

/root/frp/frps替换为执行文件的位置,/root/frp/frps.toml为配置文件的位置。 在https://gofrp.org/zh-cn/docs/setup/systemd/这里有一些简略介绍。 也可能是SELinux的问题,请参考#4350, 如果是其他此类配置文件异常或者端口问题,在以往的issue中都有提到,可以尝试在这个仓库里直接搜索相关问题。

你好 我的配置文件如下,请帮忙找找不能启动问题出在哪里,搞了好久都不能自动启动,搞不懂怎么回事了。

Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/frps
Description=LSB: starts the frps
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=all.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/frps start
ExecStop=/etc/init.d/frps stop

这个配置文件把启动指向了/etc/init.d/frps,如果frps是一个脚本,需要检查这个脚本的正确性,如果是某个发行包的可执行文件,那么后面接的start参数无法成功识别,需要手动指向一个配置文件。如果仍然不能确定问题,可以继续提供错误日志。
建议提供所使用的发行包版本号,系统版本,具体是如何配置的,系统守护进程的启动日志和frps的日志以及frps所使用的配置文件信息。

<!-- gh-comment-id:2454712732 --> @phil616 commented on GitHub (Nov 4, 2024): > > 可能是您的服务文件配置出现了问题,请提供您的配置文件或者可以尝试我在下面提供的 > > > > ``` > > [Unit] > > Description=frps service > > After=network.target > > > > [Service] > > Type=simple > > ExecStart=/root/frp/frps -c /root/frp/frps.toml > > Restart=on-failure > > RestartSec=5s > > > > [Install] > > WantedBy=multi-user.target > > ``` > > > > 将`/root/frp/frps`替换为执行文件的位置,/root/frp/frps.toml为配置文件的位置。 在https://gofrp.org/zh-cn/docs/setup/systemd/这里有一些简略介绍。 也可能是SELinux的问题,请参考[#4350,](https://github.com/fatedier/frp/issues/4350) 如果是其他此类配置文件异常或者端口问题,在以往的issue中都有提到,可以尝试在这个仓库里直接搜索相关问题。 > > 你好 我的配置文件如下,请帮忙找找不能启动问题出在哪里,搞了好久都不能自动启动,搞不懂怎么回事了。 > > # Automatically generated by systemd-sysv-generator > > [Unit] > Documentation=man:systemd-sysv-generator(8) > SourcePath=/etc/init.d/frps > Description=LSB: starts the frps > Before=multi-user.target > Before=multi-user.target > Before=multi-user.target > Before=graphical.target > After=all.target > > [Service] > Type=forking > Restart=no > TimeoutSec=5min > IgnoreSIGPIPE=no > KillMode=process > GuessMainPID=no > RemainAfterExit=yes > SuccessExitStatus=5 6 > ExecStart=/etc/init.d/frps start > ExecStop=/etc/init.d/frps stop > > 这个配置文件把启动指向了/etc/init.d/frps,如果frps是一个脚本,需要检查这个脚本的正确性,如果是某个发行包的可执行文件,那么后面接的start参数无法成功识别,需要手动指向一个配置文件。如果仍然不能确定问题,可以继续提供错误日志。 建议提供所使用的发行包版本号,系统版本,具体是如何配置的,系统守护进程的启动日志和frps的日志以及frps所使用的配置文件信息。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3571
No description provided.