add systemd service file.

This commit is contained in:
nadoo 2017-07-24 17:16:40 +08:00
parent f5052770c0
commit 772eef1563
4 changed files with 30 additions and 35 deletions

View File

@ -1,7 +1,7 @@
# glider
glider is a forward proxy with several protocols support.
glider is a forward proxy with multiple protocols support.
We can set up local listeners as proxy, and forward requests to internet via forwarders.
we can set up local listeners as proxy, and forward requests to internet via forwarders.
```
|Forwarder ----------------->|
Listener --> | | Internet
@ -147,38 +147,7 @@ checkduration=30
See [glider.conf.example](https://github.com/nadoo/glider/blob/master/glider.conf.example)
## Service
```bash
cd /etc/systemd/system/
vim glider.service
```
```bash
[Unit]
Description=glider
After=network.target
[Service]
Type=simple
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/glider
ExecStartPre=/bin/chown nobody:nobody /run/glider
# NOTE: change to your glider path
ExecStart=/opt/glider/glider -config /opt/glider/glider.conf
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -INT $MAINPID
Restart=always
User=nobody
Group=nobody
UMask=0027
[Install]
WantedBy=multi-user.target
```
```bash
systemctl enable glider.service
systemctl start glider.service
```
- Systemd: [https://github.com/nadoo/glider/blob/master/systemd/](https://github.com/nadoo/glider/blob/master/systemd/)
## Links
- [go-ss2](https://github.com/shadowsocks/go-shadowsocks2): the core ss protocol support

View File

@ -3,7 +3,7 @@
# / /`_ | | | | | | \ | |_ | |_)
# \_\_/ |_|__ |_| |_|_/ |_|__ |_| \
#
# Glider is a forward proxy with several protocols support.
# Glider is a forward proxy with multiple protocols support.
#
# We can set up local listeners as proxy, and forward requests to internet via forwarders.
#

14
systemd/README.md Normal file
View File

@ -0,0 +1,14 @@
## Service
```bash
# copy service file to systemd
cp systemd/glider@.service /etc/systemd/system/
# copy config file to /etc/glider/
mkdir /etc/glider/
cp glider.conf.example /etc/glider/server.conf
# enable and start service
systemctl enable glider@server
systemctl start glider@server
```
See [glider@.service](https://github.com/nadoo/glider/blob/master/sytemd/glider@.service)

12
systemd/glider@.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Glider Service (%i)
After=network.target
[Service]
Type=simple
User=nobody
Restart=always
ExecStart=/usr/bin/glider -config /etc/glider/%i.conf
[Install]
WantedBy=multi-user.target