I've searched the mlist archive and have learned that I should avoid daemonize as much as possible. So instead of label my program as a daemon (or singleton or anything), let me describe what I need to do.
I need the program (say, named as`myprog`) to fork into the background (if possible) with the "start" command-line option. What's important is that when `myprog` is called with other command-line options, it will *communicate with the running background process*. To make it very simple, myprog will keep an internal counter that increases every second, - when `myprog status` is called, the internal counter's value is printed. - when `myprog restart` is called, the internal counter's value is reset to zero. - when `myprog stop` is called, the background process is terminated. What's the simplest way to write such simple program in Go? Thanks -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.