use pre exec

This commit is contained in:
Cory Schwartz 2021-02-17 07:05:30 -08:00
parent 6b9478f862
commit fca183161a
3 changed files with 1 additions and 19 deletions

View File

@ -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"

View File

@ -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

View File

@ -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