Skip to content

Instantly share code, notes, and snippets.

@heartnn
Forked from ihipop/frp systemd.md
Created September 11, 2018 01:06
Show Gist options
  • Save heartnn/d4cbbedd634f9810a0a6efec367ce64f to your computer and use it in GitHub Desktop.
Save heartnn/d4cbbedd634f9810a0a6efec367ce64f to your computer and use it in GitHub Desktop.
FRP systemd 启动脚本

/etc/systemd/system/frps.service

[Unit]
Description=FRP Server Daemon

[Service]
Type=simple
ExecStartPre=-/usr/sbin/setcap cap_net_bind_service=+ep /opt/bin/frps
ExecStart=/opt/bin/frps -c /opt/etc/frps.ini
Restart=always
RestartSec=20s
User=nobody
PermissionsStartOnly=true

[Install]
WantedBy=multi-user.target

/etc/systemd/system/frpc.service

[Unit]
Description=FRP Client Daemon
After=network.target
Wants=network.target

[Service]
Type=simple
ExecStart=/opt/bin/frps -c /opt/etc/frpc.ini
Restart=always
RestartSec=20s
User=nobody

[Install]
WantedBy=multi-user.target

Config

systemctl enable frpc
systemctl status frpc
systemctl enable frps
systemctl status frps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment