mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
doc: add systemd setup procedure
This commit is contained in:
parent
f59bd64c7c
commit
d01fcb304d
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
* [Helm Chart Deployment](deployment/helm-chart.md)
|
* [Helm Chart Deployment](deployment/helm-chart.md)
|
||||||
|
* [Setting up Systemd](deployment/systemd.md)
|
||||||
|
|
||||||
### Strategies
|
### Strategies
|
||||||
* [Grid](strategy/grid.md) - Grid Strategy Explanation
|
* [Grid](strategy/grid.md) - Grid Strategy Explanation
|
||||||
|
|
42
doc/deployment/systemd.md
Normal file
42
doc/deployment/systemd.md
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
## Setting up Systemd
|
||||||
|
|
||||||
|
If you want to deploy your bbgo binary to a linux system, you could use the systemd to launch your daemon.
|
||||||
|
|
||||||
|
To do this, add service file into the directory `/etc/systemd/system/bbgo.service` with the following content:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
[Unit]
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
WorkingDirectory=/home/bbgo
|
||||||
|
# KillMode=process
|
||||||
|
ExecStart=/home/bbgo/bbgo run
|
||||||
|
User=bbgo
|
||||||
|
Restart=always
|
||||||
|
RestartSec=60
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, to load the service file, you need to run:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
systemctl daemon-reload
|
||||||
|
```
|
||||||
|
|
||||||
|
And then you can start your service by running enable and start:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
systemctl enable bbgo.service
|
||||||
|
systemctl start bbgo.service
|
||||||
|
```
|
||||||
|
|
||||||
|
To stop your service, you can run:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
systemctl stop bbgo.service
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user