Skip to content

Commit

Permalink
Merge pull request #984 from Chia-Network/auto-restart
Browse files Browse the repository at this point in the history
build:  add auto-restart functionality to systemd
  • Loading branch information
TheLastCicada authored Dec 12, 2023
2 parents f882276 + b4877a0 commit 75082c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build-scripts/deb/cadt@.service
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
[Unit]
Description=CADT

# 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 @@ -27,5 +31,9 @@ ExecStart=/opt/cadt/cadt
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 75082c6

Please sign in to comment.