Does your long lived command look like a standard unix service? Want to run it on windows?
import _ "github.com/kardianos/minwinsvc"
This one line will allow your executable to be run as a windows service. It is a noop on other platforms (but still compiles). It registers and maintains callbacks that windows services require. You can install using normal windows tools like:
sc create "ServiceName" binPath= "executable path"
(there is a space between the β=β and the parameter value)
Windows by default sets the CWD to C:\windows\system32 and you canβt set env vars. But you can set command line arguments when installing.
Might be useful to people needing a quick way to run unix services on windows with almost no modification.