Merge pull request #1852 from filecoin-project/feat/systemd-usage
Update systemd usage and docs
This commit is contained in:
commit
70e690dac0
12
Makefile
12
Makefile
@ -103,6 +103,18 @@ install:
|
||||
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
|
||||
install -C ./lotus-seal-worker /usr/local/bin/lotus-seal-worker
|
||||
|
||||
install-services:
|
||||
install -C -m 0644 ./scripts/lotus-daemon.service /etc/systemd/system/lotus-daemon.service
|
||||
install -C -m 0644 ./scripts/lotus-miner.service /etc/systemd/system/lotus-miner.service
|
||||
systemctl daemon-reload
|
||||
@echo
|
||||
@echo "lotus and lotus-miner services installed. Don't forget to 'systemctl enable lotus|lotus-miner' for it to be enabled on startup."
|
||||
|
||||
clean-services:
|
||||
rm -f /etc/systemd/system/lotus-daemon.service
|
||||
rm -f /etc/systemd/system/lotus-miner.service
|
||||
systemctl daemon-reload
|
||||
|
||||
# TOOLS
|
||||
|
||||
lotus-seed: $(BUILD_DEPS)
|
||||
|
29
documentation/en/install-systemd-services.md
Normal file
29
documentation/en/install-systemd-services.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Lotus and Miner as a systemd service
|
||||
|
||||
Lotus is capable of running as a systemd service daemon. You can find installable service files for systemd in the [lotus repo](https://github.com/filecoin-project/lotus/tree/master/scripts) as files with `.service` extension. In order to install these service files, you can copy these `.service` files to the default systemd service path.
|
||||
|
||||
## Installing via `make`
|
||||
|
||||
NOTE: Before using lotus and lotus-miner as systemd services, don't forget to `sudo make install` to ensure the binaries are accessible by the root user.
|
||||
|
||||
If your host uses the default systemd service path, it can be installed with `sudo make install-services`:
|
||||
|
||||
```sh
|
||||
$ sudo make install-services
|
||||
```
|
||||
|
||||
## Interacting with service logs
|
||||
|
||||
Logs from the services can be reviewed using `journalctl`.
|
||||
|
||||
### Follow logs from a specific service unit
|
||||
|
||||
```sh
|
||||
$ sudo journalctl -u lotus-daemon -f
|
||||
```
|
||||
|
||||
### View logs in reverse order
|
||||
|
||||
```sh
|
||||
$ sudo journalctl -u lotus-miner -r
|
||||
```
|
@ -6,6 +6,10 @@ After=network.target
|
||||
ExecStart=/usr/local/bin/lotus daemon
|
||||
Environment=GOLOG_FILE="/var/log/lotus-daemon"
|
||||
Environment=GOLOG_LOG_FMT="json"
|
||||
MemoryAccounting=true
|
||||
MemoryHigh=8G
|
||||
MemoryMax=10G
|
||||
LimitNOFILE=8192:10240
|
||||
|
||||
[Install]
|
||||
WantedBy=multiuser.target
|
||||
|
Loading…
Reference in New Issue
Block a user