[GH-ISSUE #2918] Cannot start frpc with systemctl #2323

Closed
opened 2026-05-05 13:30:01 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @sgpublic on GitHub (Apr 29, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2918

Bug Description

I'm running frpc with systemctl on CentOS 8.5, I copied frpc.service and frpc@.service to the path of /usr/lib/systemd/system/, and frpc.ini to the path of /etc/frp/frpc.ini, then I run command systemctl start frpc, but it seems failed to start, systemctl status frpc shows:

● frpc.service - Frp Client Service
   Loaded: loaded (/usr/lib/systemd/system/frpc.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2022-04-29 20:38:13 CST; 1s ago
  Process: 17329 ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini (code=exited, status=1/FAILURE)
 Main PID: 17329 (code=exited, status=1/FAILURE)

But frpc can be start successfully with command /usr/bin/frpc -c /etc/frp/frpc.ini.

I‘m sorry about that I have no idea with how to find any other log, so how can I solve it? Thanks adcanced.

frpc Version

0.42.0

frps Version

0.42.0

System Architecture

linux/amd64

Configurations

frps.ini

[common]
bind_port = 7000

frpc.ini

[common]
server_addr = xxx.xxx.xxx.xxx
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @sgpublic on GitHub (Apr 29, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/2918 ### Bug Description I'm running frpc with systemctl on CentOS 8.5, I copied `frpc.service` and `frpc@.service` to the path of `/usr/lib/systemd/system/`, and `frpc.ini` to the path of `/etc/frp/frpc.ini`, then I run command `systemctl start frpc`, but it seems failed to start, `systemctl status frpc` shows: ``` ● frpc.service - Frp Client Service Loaded: loaded (/usr/lib/systemd/system/frpc.service; enabled; vendor preset: disabled) Active: activating (auto-restart) (Result: exit-code) since Fri 2022-04-29 20:38:13 CST; 1s ago Process: 17329 ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini (code=exited, status=1/FAILURE) Main PID: 17329 (code=exited, status=1/FAILURE) ``` But frpc can be start successfully with command `/usr/bin/frpc -c /etc/frp/frpc.ini`. I‘m sorry about that I have no idea with how to find any other log, so how can I solve it? Thanks adcanced. ### frpc Version 0.42.0 ### frps Version 0.42.0 ### System Architecture linux/amd64 ### Configurations frps.ini ``` [common] bind_port = 7000 ``` frpc.ini ``` [common] server_addr = xxx.xxx.xxx.xxx server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 ``` ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:30:01 -06:00
Author
Owner

@fatedier commented on GitHub (Apr 29, 2022):

You'd better write your own service file. We will remove these files in future release.

<!-- gh-comment-id:1113312729 --> @fatedier commented on GitHub (Apr 29, 2022): You'd better write your own service file. We will remove these files in future release.
Author
Owner

@penguine commented on GitHub (May 17, 2022):

have you the correct user in frp.service? normally the script works. you only need the frpc.service file.

<!-- gh-comment-id:1128837792 --> @penguine commented on GitHub (May 17, 2022): have you the correct user in frp.service? normally the script works. you only need the frpc.service file.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 17, 2022):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1158339063 --> @github-actions[bot] commented on GitHub (Jun 17, 2022): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Author
Owner

@ututono commented on GitHub (Jun 2, 2023):

Hi. I met the same issue as yours. Have you solve it or any idea?

<!-- gh-comment-id:1573616317 --> @ututono commented on GitHub (Jun 2, 2023): Hi. I met the same issue as yours. Have you solve it or any idea?
Author
Owner

@sgpublic commented on GitHub (Jun 2, 2023):

Hi. I met the same issue as yours. Have you solve it or any idea?

Hi! This is my service file, and you can replace ExecStart with your own:

[Unit]
Description=Frp Client
After=network.target network-online.target
Requires=network-online.target

[Service]
ExecStart=/approot/bin/frpc -c /approot/etc/frpc.d/frpc.ini
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
<!-- gh-comment-id:1573634667 --> @sgpublic commented on GitHub (Jun 2, 2023): > Hi. I met the same issue as yours. Have you solve it or any idea? Hi! This is my service file, and you can replace `ExecStart` with your own: ``` [Unit] Description=Frp Client After=network.target network-online.target Requires=network-online.target [Service] ExecStart=/approot/bin/frpc -c /approot/etc/frpc.d/frpc.ini Restart=always RestartSec=5 [Install] WantedBy=multi-user.target ```
Author
Owner

@ututono commented on GitHub (Jun 2, 2023):

Hi. I met the same issue as yours. Have you solve it or any idea?

Hi! This is my service file, and you can replace ExecStart with your own:

[Unit]
Description=Frp Client
After=network.target network-online.target
Requires=network-online.target

[Service]
ExecStart=/approot/bin/frpc -c /approot/etc/frpc.d/frpc.ini
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Thank for your prompt reply. It turns out that the ExectStart was wrong in my config file. It runs well now.

<!-- gh-comment-id:1573650732 --> @ututono commented on GitHub (Jun 2, 2023): > > Hi. I met the same issue as yours. Have you solve it or any idea? > > Hi! This is my service file, and you can replace `ExecStart` with your own: > > ``` > [Unit] > Description=Frp Client > After=network.target network-online.target > Requires=network-online.target > > [Service] > ExecStart=/approot/bin/frpc -c /approot/etc/frpc.d/frpc.ini > Restart=always > RestartSec=5 > > [Install] > WantedBy=multi-user.target > ``` Thank for your prompt reply. It turns out that the `ExectStart` was wrong in my config file. It runs well now.
Author
Owner

@sealionking commented on GitHub (Jun 3, 2023):

Hi. I met the same issue as yours. Have you solve it or any idea?

Hi! This is my service file, and you can replace ExecStart with your own:

[Unit]
Description=Frp Client
After=network.target network-online.target
Requires=network-online.target

[Service]
ExecStart=/approot/bin/frpc -c /approot/etc/frpc.d/frpc.ini
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

it works after setting the authentication config according the frps.ini

without setting it,the frpc.service failed.

<!-- gh-comment-id:1575232309 --> @sealionking commented on GitHub (Jun 3, 2023): > > Hi. I met the same issue as yours. Have you solve it or any idea? > > Hi! This is my service file, and you can replace `ExecStart` with your own: > > ``` > [Unit] > Description=Frp Client > After=network.target network-online.target > Requires=network-online.target > > [Service] > ExecStart=/approot/bin/frpc -c /approot/etc/frpc.d/frpc.ini > Restart=always > RestartSec=5 > > [Install] > WantedBy=multi-user.target > ``` it works after setting the authentication config according the frps.ini without setting it,the frpc.service failed.
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#2323
No description provided.