From a4cfab689a361900bfc84330911723e40a9f2a58 Mon Sep 17 00:00:00 2001 From: a-wing <1@233.email> Date: Thu, 21 Mar 2019 11:38:26 +0800 Subject: [PATCH] Add systemd unit Ref https://github.com/fatedier/frp/issues/1058 Ref https://aur.archlinux.org/packages/frp/ Co-authored-by: vimsucks --- conf/systemd/frpc.service | 14 ++++++++++++++ conf/systemd/frpc@.service | 14 ++++++++++++++ conf/systemd/frps.service | 13 +++++++++++++ conf/systemd/frps@.service | 13 +++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 conf/systemd/frpc.service create mode 100644 conf/systemd/frpc@.service create mode 100644 conf/systemd/frps.service create mode 100644 conf/systemd/frps@.service diff --git a/conf/systemd/frpc.service b/conf/systemd/frpc.service new file mode 100644 index 00000000..dd88ce01 --- /dev/null +++ b/conf/systemd/frpc.service @@ -0,0 +1,14 @@ +[Unit] +Description=Frp Client Service +After=network.target + +[Service] +Type=simple +User=nobody +Restart=on-failure +RestartSec=5s +ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini +ExecReload=/usr/bin/frpc reload -c /etc/frp/frpc.ini + +[Install] +WantedBy=multi-user.target diff --git a/conf/systemd/frpc@.service b/conf/systemd/frpc@.service new file mode 100644 index 00000000..46251ed8 --- /dev/null +++ b/conf/systemd/frpc@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Frp Client Service +After=network.target + +[Service] +Type=idle +User=nobody +Restart=on-failure +RestartSec=5s +ExecStart=/usr/bin/frpc -c /etc/frp/%i.ini +ExecReload=/usr/bin/frpc reload -c /etc/frp/%i.ini + +[Install] +WantedBy=multi-user.target diff --git a/conf/systemd/frps.service b/conf/systemd/frps.service new file mode 100644 index 00000000..1daa2674 --- /dev/null +++ b/conf/systemd/frps.service @@ -0,0 +1,13 @@ +[Unit] +Description=Frp Server Service +After=network.target + +[Service] +Type=simple +User=nobody +Restart=on-failure +RestartSec=5s +ExecStart=/usr/bin/frps -c /etc/frp/frps.ini + +[Install] +WantedBy=multi-user.target diff --git a/conf/systemd/frps@.service b/conf/systemd/frps@.service new file mode 100644 index 00000000..8b625ca7 --- /dev/null +++ b/conf/systemd/frps@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Frp Server Service +After=network.target + +[Service] +Type=simple +User=nobody +Restart=on-failure +RestartSec=5s +ExecStart=/usr/bin/frps -c /etc/frp/%i.ini + +[Install] +WantedBy=multi-user.target