Daemonizing Go Programs (with a BSD-style rc.d example)

from blog Andrew Gallant's Blog on Andrew Gallant's Blog, | ↗ original
Go, by its very nature, is multithreaded. This makes a traditional approach of daemonizing Go programs by forking a bit difficult. To get around this, you could try something as simple as backgrounding your Go program and instructing it to ignore the HUP signal: