I need help understanding how to demonize a process in Go.
package main
import (
\"fmt\"
\"os\"
)
func start() {
var procAttr os.ProcAttr
proc
AFAIK Go doesn't yet fully support writing true daemons in Go. Some of the previous discussions about this topic:
https://groups.google.com/d/topic/golang-nuts/KynZO5BQGks/discussion
https://groups.google.com/d/topic/golang-nuts/1bF39FuX-48/discussion
https://groups.google.com/d/topic/golang-nuts/0P_kErKUCEU/discussion
https://groups.google.com/d/topic/golang-nuts/BSvqvyOqX-I/discussion
https://groups.google.com/d/topic/golang-nuts/H6d-3UfAa1A/discussion
I asked in 'golang-nuts', and found out that golang has a link option:
go tool 8l -o output.exe -Hwindowsgui input.8
Here is a fake daemon in go; it's simple to use: https://github.com/icattlecoder/godaemon
An example:
package main
import (
_ "github.com/icattlecoder/godaemon"
"log"
"net/http"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/index", func(rw http.ResponseWriter, req *http.Request) {
rw.Write([]byte("hello, golang!\n"))
})
log.Fatalln(http.ListenAndServe(":7070", mux))
}