From 39aee94fe2968a7d3a9df7c3706eb7bc34318eba Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 17 Feb 2021 07:05:30 -0800 Subject: [PATCH] use pre exec --- tools/packer/lotus.pkr.hcl | 4 ---- tools/packer/systemd/lotus-daemon.service | 3 +-- tools/packer/systemd/lotus-init.service | 13 ------------- 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 tools/packer/systemd/lotus-init.service diff --git a/tools/packer/lotus.pkr.hcl b/tools/packer/lotus.pkr.hcl index 95d93f4aee1..347cfb9489e 100644 --- a/tools/packer/lotus.pkr.hcl +++ b/tools/packer/lotus.pkr.hcl @@ -76,10 +76,6 @@ build { source = "./tools/packer/systemd/lotus-miner.service" destination = "lotus-miner.service" } - provisioner "file" { - source = "./tools/packer/systemd/lotus-init.service" - destination = "lotus-init.service" - } provisioner "file" { source = "./tools/packer/homedir/LOTUS.txt" destination = "LOTUS.txt" diff --git a/tools/packer/systemd/lotus-daemon.service b/tools/packer/systemd/lotus-daemon.service index a8a6c2f41d9..0c14a4ab06a 100644 --- a/tools/packer/systemd/lotus-daemon.service +++ b/tools/packer/systemd/lotus-daemon.service @@ -1,12 +1,11 @@ [Unit] Description=Lotus Daemon After=network.target -After=lotus-init.service -Wants=lotus-init.service [Service] User=fc Group=fc +ExecStartPre=/usr/local/bin/lotus-init.sh ExecStart=/usr/local/bin/lotus daemon Environment=LOTUS_PATH=/var/lib/lotus Restart=always diff --git a/tools/packer/systemd/lotus-init.service b/tools/packer/systemd/lotus-init.service deleted file mode 100644 index 5a9cb12db16..00000000000 --- a/tools/packer/systemd/lotus-init.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Type=oneshot -Description=Sync Lotus chain for the first time - -[Service] -User=fc -Group=fc -ExecStart=/usr/local/bin/lotus-init.sh -Environment=LOTUS_PATH=/var/lib/lotus -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target