glider/systemd/README.md

73 lines
1.1 KiB
Markdown
Raw Normal View History

2017-07-24 17:16:40 +08:00
## Service
2017-07-24 17:22:13 +08:00
### Install
#### 1. copy binary file
2017-07-27 01:22:56 +08:00
```bash
cp glider /usr/bin/
```
2017-07-24 17:22:13 +08:00
#### 2. add service file
2017-07-24 17:16:40 +08:00
```bash
# copy service file to systemd
cp systemd/glider@.service /etc/systemd/system/
2017-07-24 17:22:13 +08:00
```
2017-07-24 17:16:40 +08:00
#### 3. add config file: ***server***.conf
2017-07-24 17:22:13 +08:00
```bash
2017-07-24 17:16:40 +08:00
# copy config file to /etc/glider/
mkdir /etc/glider/
2018-02-08 11:13:21 +08:00
cp ./config/glider.conf.example /etc/glider/server.conf
2017-07-24 17:22:13 +08:00
```
2017-07-24 17:16:40 +08:00
#### 4. enable and start service: glider@***server***
2017-07-24 17:22:13 +08:00
```bash
2017-07-24 17:16:40 +08:00
# enable and start service
systemctl enable glider@server
systemctl start glider@server
```
2017-08-14 00:02:05 +08:00
See [glider@.service](glider%40.service)
### Open file limit
#### 1. setup system limit
vim /etc/security/limits.d/unlimited.conf
```bash
* soft nofile unlimited
* hard nofile unlimited
* soft nproc unlimited
* hard nproc unlimited
```
#### 2. change **systemd** limit
```bash
echo DefaultLimitNOFILE=102400 >> /etc/systemd/system.conf
echo DefaultLimitNOFILE=102400 >> /etc/systemd/user.conf
```
#### 3. reexec **systemd**
```bash
systemctl daemon-reexec
```
#### 4. restart glider service
```bash
systemctl restart glider@server
```
#### 5. check the limits of PID
```bash
cat /proc/PID/limits
```