diff --git a/README.md b/README.md index 25537220..db61a4e9 100644 --- a/README.md +++ b/README.md @@ -1285,6 +1285,9 @@ To enable an experimental feature, add the feature gate to your configuration: ```toml featureGates = { VirtualNet = true } ``` +### Enable as systemd service + +Read the [document](/doc/systemd_service.md). ### Feature Lifecycle diff --git a/doc/systemd_service.md b/doc/systemd_service.md new file mode 100644 index 00000000..88813e14 --- /dev/null +++ b/doc/systemd_service.md @@ -0,0 +1,32 @@ +# Install systemd unit + +## install binary + +```sudo install ./frps /usr/local/bin``` + +## Create systemd unit + +```sudo vi /lib/systemd/syste.frps.service``` + + + +```[Unit] +Description=FRP Server Service +After=network.target + +[Service] +Type=simple +ExecStart=/usr/local/bin/frps -c /usr/local/etc/frp/frps.toml +Restart=on-failure +RestartSec=15s + +[Install] +WantedBy=multi-user.target + +## Enable service + +```sudo systemctl daemon-reload +sudo systemctl enable frps.service +sudo systemctl start frps.service +sudo systemctl status frps.service``` +