cculianu / Fulcrum

A fast & nimble SPV Server for BCH, BTC, and LTC
Other
343 stars 77 forks source link

[Feature Request] Add PID support #147

Closed melroy89 closed 1 year ago

melroy89 commented 1 year ago

Just like bitcoind has an -pid option to specify a PID file. Like so: -pid=/run/bitcoind/bitcoind.pid

I would like to have a similar option (-pid) for Fulcrum, which allows me to easier manage the service in case of emergencies/failures.

That would be great, thanks in advance!

Regards, Melroy van den Berg

cculianu commented 1 year ago

Hmm. Any chance you can just parse the json from Fulcrum's "admin" port getinfo call? It reports its PID in there.. On my system this is how I do it (my FulcrumAdmin port is port 8000 on localhost):

$ ./FulcrumAdmin -p 8000 getinfo | jq .pid
melroy89 commented 1 year ago

Nah. I'm now using the Monit matching by process pattern instead of pidfile.

check process Fulcrum matching "fulcrum"

Which is good enough for now, I just think that a pidfile is maybe more robust. I could be wrong.

cculianu commented 1 year ago

Ok, I added this to master just now. The CLI arg is --pidfile and the conf file var is pidfile=. I will do a Fulcrum release soon which will include this change.

melroy89 commented 1 year ago

Nice!