Merge pull request #388 from filecoin-project/misc/systemd-units

Update service names
This commit is contained in:
Łukasz Magiera 2019-10-17 10:59:35 +02:00 committed by GitHub
commit 9f4ab8f37f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 15 deletions

View File

@ -1,23 +1,38 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
HOST=$1
# upload binaries
# TODO: destroy
ssh "$HOST" 'systemctl stop lotus-storage-miner'
ssh "$HOST" 'systemctl stop lotus-daemon'
FILES_TO_SEND=(
./louts
./lotus-storage-miner
scripts/lotus-daemon.service
scripts/louts-miner.service
)
ssh "$HOST" 'mkdir -p .lotus .lotusstorage' &
scp "./lotus" "$HOST:/usr/local/bin" &
scp "./lotus-storage-miner" "$HOST:/usr/local/bin" &
scp -C scripts/daemon.service "${HOST}:/etc/systemd/system/lotus-daemon.service" &
scp -C scripts/sminer.service "${HOST}:/etc/systemd/system/lotus-storage-miner.service" &
wait
rsync -P "${FILES_TO_SEND[@]}" "$HOST:~/lotus-stage/"
ssh "$HOST" 'systemctl daemon-reload'
ssh "$HOST" 'systemctl start lotus-daemon' &
wait
ssh "$HOST" 'bash -s' << 'EOF'
set -euo pipefail
systemctl stop lotus-storage-miner
systemctl stop lotus-daemon
mkdir -p .lotus .lotusstorage
cd "$HOME/lotus-stage/"
cp -f louts lotus-storage-miner /usr/local/bin
cp -f lotus-daemon.service /etc/systemd/system/lotus-daemon.service
cp -f lotus-miner.service /etc/systemd/system/lotus-storage-miner.service
systemctl daemon-reload
systemctl start lotus-daemon
EOF
# setup miner actor

View File

@ -4,7 +4,7 @@ After=network.target
[Service]
ExecStart=/usr/local/bin/lotus daemon
Environment=GOLOG_FILE="/root/.lotus/logs"
Environment=GOLOG_FILE="/var/log/lotus-daemon"
Environment=GOLOG_LOG_FMT="json"
[Install]

View File

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

View File

@ -2,5 +2,5 @@
HOST=$1
scp scripts/daemon.service "${HOST}:/etc/systemd/system/lotus-daemon.service"
scp scripts/sminer.service "${HOST}:/etc/systemd/system/lotus-storage-miner.service"
scp scripts/lotus-daemon.service "${HOST}:/etc/systemd/system/lotus-daemon.service"
scp scripts/lotus-miner.service "${HOST}:/etc/systemd/system/lotus-storage-miner.service"