Skip to content

Commit

Permalink
Merge pull request #190 from Chia-Network/systemd-autorestart
Browse files Browse the repository at this point in the history
build: auto-restart with systemd
  • Loading branch information
TheLastCicada authored Dec 13, 2023
2 parents 695e575 + fc51637 commit 07a3c3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build-scripts/deb/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
[Unit]
Description=Climate Tokenization Engine

# Stop automatically restarting if 10 failures in 5 minutes
StartLimitIntervalSec=300
StartLimitBurst=10

[Service]
# Set Chia directory as an environment variable
Environment=CHIA_ROOT=/home/%i/.chia/mainnet
Expand All @@ -30,5 +34,9 @@ ExecStart=/opt/climate-tokenization-engine/climate-tokenization-engine
User=%i
Group=%i

# Auto-restart if process stopped outside of systemd
Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target

0 comments on commit 07a3c3a

Please sign in to comment.