forked from c9s/bbgo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` | ||
|