From c0cdcbb9e0b51b16a0db5832c36df9ba713d54df Mon Sep 17 00:00:00 2001 From: Mike Greenberg Date: Thu, 4 Jun 2020 08:09:01 -0400 Subject: [PATCH] Adjust service logging and startup settings --- Makefile | 3 ++- scripts/chainwatch.service | 5 ++++- scripts/lotus-daemon.service | 6 +++--- scripts/lotus-miner.service | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index fdf9e7e09..5db557d7e 100644 --- a/Makefile +++ b/Makefile @@ -105,11 +105,12 @@ 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 diff --git a/scripts/chainwatch.service b/scripts/chainwatch.service index 47af6b59e..e958ec857 100644 --- a/scripts/chainwatch.service +++ b/scripts/chainwatch.service @@ -1,12 +1,15 @@ [Unit] Description=Chainwatch +PartOf=sentinel.service After=lotus-daemon.service Requires=lotus-daemon.service [Service] -ExecStart=/usr/local/bin/chainwatch run +Environment=GOLOG_FILE="/var/log/lotus/chainwatch.log" +Environment=GOLOG_LOG_FMT="json" Environment=LOTUS_DB="postgres://postgres:password@localhost:5432/postgres?sslmode=disable" Environment=LOTUS_PATH="/root/.lotus" +ExecStart=/usr/local/bin/chainwatch run [Install] WantedBy=multiuser.target diff --git a/scripts/lotus-daemon.service b/scripts/lotus-daemon.service index 46bc47bdb..99a94e217 100644 --- a/scripts/lotus-daemon.service +++ b/scripts/lotus-daemon.service @@ -1,15 +1,15 @@ [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 #ExecStop=/bin/sh -a -c /root/capture_lotus_heap.sh Restart=always -RestartSec=30 +RestartSec=10 MemoryAccounting=true MemoryHigh=8G diff --git a/scripts/lotus-miner.service b/scripts/lotus-miner.service index 7b866e043..3a460450f 100644 --- a/scripts/lotus-miner.service +++ b/scripts/lotus-miner.service @@ -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]