[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, which is non-zero, so Restart=on-failure restarts it into the new binary. Restart=on-failure RestartSec=2 NoNewPrivileges=yes LimitNOFILE=65536 [Install] WantedBy=default.target