Merge pull request #1894 from filecoin-project/feat/chainwatch-usage

Add chainwatch systemd svc config
This commit is contained in:
Łukasz Magiera 2020-06-22 22:25:48 +02:00 committed by GitHub
commit 8638076ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 5 deletions

View File

@ -105,15 +105,17 @@ install:
install-services: install
mkdir -p /usr/local/lib/systemd/system
mkdir -p /var/log/lotus
install -C -m 0644 ./scripts/lotus-daemon.service /usr/local/lib/systemd/system/lotus-daemon.service
install -C -m 0644 ./scripts/lotus-miner.service /usr/local/lib/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."
@echo "lotus-daemon and lotus-miner services installed. Don't forget to 'systemctl enable lotus-daemon|lotus-miner' for it to be enabled on startup."
clean-services:
rm -f /usr/local/lib/systemd/system/lotus-daemon.service
rm -f /usr/local/lib/systemd/system/lotus-miner.service
rm -f /usr/local/lib/systemd/system/chainwatch.service
systemctl daemon-reload
# TOOLS
@ -160,6 +162,13 @@ chainwatch:
.PHONY: chainwatch
BINS+=chainwatch
install-chainwatch-service: chainwatch
install -C ./chainwatch /usr/local/bin/chainwatch
install -C -m 0644 ./scripts/chainwatch.service /usr/local/lib/systemd/system/chainwatch.service
systemctl daemon-reload
@echo
@echo "chainwatch installed. Don't forget to 'systemctl enable chainwatch' for it to be enabled on startup."
bench:
rm -f bench
go build -o bench ./cmd/lotus-bench

View File

@ -0,0 +1,15 @@
[Unit]
Description=Chainwatch
After=lotus-daemon.service
Requires=lotus-daemon.service
[Service]
Environment=GOLOG_FILE="/var/log/lotus/chainwatch.log"
Environment=GOLOG_LOG_FMT="json"
Environment=LOTUS_DB=""
Environment=LOTUS_PATH="%h/.lotus"
EnvironmentFile=-/etc/lotus/chainwatch.env
ExecStart=/usr/local/bin/chainwatch run
[Install]
WantedBy=multi-user.target

View File

@ -1,14 +1,14 @@
[Unit]
Description=Lotus Daemon
After=network-online.target
Wants=network-online.target
Requires=network-online.target
[Service]
Environment=GOLOG_FILE="/var/log/lotus-daemon"
Environment=GOLOG_FILE="/var/log/lotus/daemon.log"
Environment=GOLOG_LOG_FMT="json"
ExecStart=/usr/local/bin/lotus daemon
Restart=always
RestartSec=30
RestartSec=10
MemoryAccounting=true
MemoryHigh=8G

View File

@ -2,10 +2,11 @@
Description=Lotus Storage Miner
After=network.target
After=lotus-daemon.service
Requires=lotus-daemon.service
[Service]
ExecStart=/usr/local/bin/lotus-storage-miner run
Environment=GOLOG_FILE="/var/log/lotus-miner"
Environment=GOLOG_FILE="/var/log/lotus/miner.log"
Environment=GOLOG_LOG_FMT="json"
[Install]