fix: correct deb config paths and add non-templated frpc/frps services

This commit is contained in:
2026-01-26 13:59:32 +08:00
parent 5edcaeb1c9
commit b0e29c85d3
6 changed files with 57 additions and 11 deletions

View File

@@ -99,6 +99,8 @@ jobs:
cp frpc@.service ~/rpmbuild/SOURCES/
cp frps@.service ~/rpmbuild/SOURCES/
cp frpc.service ~/rpmbuild/SOURCES/
cp frps.service ~/rpmbuild/SOURCES/
- name: Build RPM
run: |
@@ -142,12 +144,13 @@ jobs:
mkdir -p frpc_pkg/DEBIAN
mkdir -p frpc_pkg/usr/bin
mkdir -p frpc_pkg/lib/systemd/system
mkdir -p frpc_pkg/etc/frp
mkdir -p frpc_pkg/usr/lib/systemd/system
mkdir -p frpc_pkg/etc/frpc
cp frp_bin/frpc frpc_pkg/usr/bin/
cp frp_bin/frpc.toml frpc_pkg/etc/frp/
cp frpc@.service frpc_pkg/lib/systemd/system/
cp frp_bin/frpc.toml frpc_pkg/etc/frpc/
cp frpc@.service frpc_pkg/usr/lib/systemd/system/
cp frpc.service frpc_pkg/usr/lib/systemd/system/
cat > frpc_pkg/DEBIAN/control <<EOF
Package: frpc
@@ -170,12 +173,13 @@ jobs:
mkdir -p frps_pkg/DEBIAN
mkdir -p frps_pkg/usr/bin
mkdir -p frps_pkg/lib/systemd/system
mkdir -p frps_pkg/etc/frp
mkdir -p frps_pkg/usr/lib/systemd/system
mkdir -p frps_pkg/etc/frps
cp frp_bin/frps frps_pkg/usr/bin/
cp frp_bin/frps.toml frps_pkg/etc/frp/
cp frps@.service frps_pkg/lib/systemd/system/
cp frp_bin/frps.toml frps_pkg/etc/frps/
cp frps@.service frps_pkg/usr/lib/systemd/system/
cp frps.service frps_pkg/usr/lib/systemd/system/
cat > frps_pkg/DEBIAN/control <<EOF
Package: frps
@@ -258,7 +262,7 @@ jobs:
# Only run createrepo on RPM architecture directories
for arch in x86_64 aarch64; do
if [ -d "output/$arch" ]; then
createrepo_c "output/$arch"
createrepo_c --database --update "output/$arch"
fi
done

View File

@@ -54,7 +54,9 @@ sudo vim /etc/frpc/frpc.toml
```bash
# If using default /etc/frpc/frpc.toml:
sudo systemctl enable --now frpc@frpc
sudo systemctl enable --now frpc
# OR (template version)
# sudo systemctl enable --now frpc@frpc
# If using /etc/frpc/my-proxy.toml:
sudo systemctl enable --now frpc@my-proxy
@@ -78,6 +80,8 @@ sudo vim /etc/frps/frps.toml
2. Start Service
```bash
sudo systemctl enable --now frps
# OR (template version)
sudo systemctl enable --now frps@frps
```

View File

@@ -54,7 +54,9 @@ sudo vim /etc/frpc/frpc.toml
```bash
# 如果使用默认的 /etc/frpc/frpc.toml
sudo systemctl enable --now frpc@frpc
sudo systemctl enable --now frpc
# 或者 (模板版本)
# sudo systemctl enable --now frpc@frpc
# 如果使用 /etc/frpc/my-proxy.toml
sudo systemctl enable --now frpc@my-proxy
@@ -78,6 +80,8 @@ sudo vim /etc/frps/frps.toml
2. 启动服务
```bash
sudo systemctl enable --now frps
# 或者 (模板版本)
sudo systemctl enable --now frps@frps
```

View File

@@ -17,6 +17,8 @@ URL: https://github.com/fatedier/frp
Source0: https://github.com/fatedier/frp/releases/download/v%{version}/frp_%{version}_linux_%{goarch}.tar.gz
Source1: frpc@.service
Source2: frps@.service
Source3: frpc.service
Source4: frps.service
BuildRequires: systemd-rpm-macros
@@ -58,6 +60,8 @@ install -m 644 frps.toml %{buildroot}%{_sysconfdir}/frps/frps.toml
# Install systemd service templates
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/frpc@.service
install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/frps@.service
install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/frpc.service
install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/frps.service
%files -n frpc
%license LICENSE
@@ -65,6 +69,7 @@ install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/frps@.service
%dir %{_sysconfdir}/frpc
%config(noreplace) %{_sysconfdir}/frpc/frpc.toml
%{_unitdir}/frpc@.service
%{_unitdir}/frpc.service
%files -n frps
%license LICENSE
@@ -72,6 +77,7 @@ install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/frps@.service
%dir %{_sysconfdir}/frps
%config(noreplace) %{_sysconfdir}/frps/frps.toml
%{_unitdir}/frps@.service
%{_unitdir}/frps.service
%changelog
* %{date} awfufu <me@awfufu.com> - %{version}-%{release}

14
frpc.service Normal file
View File

@@ -0,0 +1,14 @@
[Unit]
Description=FRP Client Service
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
WorkingDirectory=/etc/frpc
ExecStart=/usr/bin/frpc -c /etc/frpc/frpc.toml
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target

14
frps.service Normal file
View File

@@ -0,0 +1,14 @@
[Unit]
Description=FRP Server Service
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
WorkingDirectory=/etc/frps
ExecStart=/usr/bin/frps -c /etc/frps/frps.toml
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target