[Unit] Description=forge After=network-online.target # Crash loops stop the unit: 3 starts within 60s, then it enters failed and OnFailure runs the rollback. StartLimitIntervalSec=60 StartLimitBurst=3 OnFailure=forge-rollback.service [Service] WorkingDirectory=%h Environment=FORGE_CONFIG=%h/config/forge.toml ExecStart=%h/bin/forge serve # A self-update exits with code 75. Restart=on-failure # Exit 75 is a deliberate restart into a new binary, not a failure: no OnFailure rollback. SuccessExitStatus=75 RestartForceExitStatus=75 RestartSec=2 NoNewPrivileges=yes LimitNOFILE=65536 [Install] WantedBy=default.target