Adding some information to an old question as apparently people find their ways to this thread at present times:
The rc.d script shown there is what I wrote to daemonize a Golang application. It was a 3rd-party tool which was prone to crashing randomly but I was forced to use it. When it crashed, the OS automatically re-launched it.
SirDice already covered this. I'd just like to add a bit more detail/perspective: You can easily daemonize an executable via daemon(8). I left some notes regarding this on my blog a while ago: https://blog.insane.engineer/post/freebsd_daemonize/And have the web applications automatically restart on crashes.
The rc.d script shown there is what I wrote to daemonize a Golang application. It was a 3rd-party tool which was prone to crashing randomly but I was forced to use it. When it crashed, the OS automatically re-launched it.