Closed sr-gi closed 1 year ago
If set to on-failure, the service will be restarted when the process exits with a non-zero exit code, is terminated by a signal (including on core dump, but excluding the aforementioned four signals), when an operation (such as service reload) times out, and when the configured watchdog timeout is triggered.
source: systemd docs
A restart isn't triggered because systemd thinks that teosd exited successfully (Main PID: 556 (code=exited, status=0/SUCCESS)
). Exiting with a non-zero exit code on bitcoind-related errors should trigger a restart.
Ohhh, I see...
https://github.com/talaia-labs/rust-teos/blob/master/teos/src/main.rs#L161
PS: Gave this a try, and changing return
by std::process::exit(1)
does the trick
teosd.service
currently has a static wait before starting to givebitcoind
some time to bootstrap. This is not optimal, we should find a better solution for it.Notice that not waiting for
bitcoind
will make us hit:See https://github.com/talaia-labs/rust-teos/pull/183#issuecomment-1418826258 for more context.