From 07f60d3157c3766b051bf30aceb0babf53fae1cf Mon Sep 17 00:00:00 2001 From: Anchor Date: Mon, 22 Dec 2014 11:46:17 -0800 Subject: [PATCH] Fix section "Daemons" in 12.3.md --- en/12.3.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/en/12.3.md b/en/12.3.md index e4e897c9..e6133a2c 100644 --- a/en/12.3.md +++ b/en/12.3.md @@ -2,13 +2,13 @@ When our web application is finally production ready, what are the steps necessary to get it deployed? In Go, an executable file encapsulating our application is created after we compile our programs. Programs written in C can run perfectly as background daemon processes, however Go does not yet have native support for daemons. The good news is that we can use third party tools to help us manage the deployment of our Go applications, examples of which are Supervisord, upstart and daemontools, among others. This section will introduce you to some basics of the Supervisord process control system. -## Daemon +## Daemons -Currently Go programs can not be achieved daemon, see the Go detailed language bug: <`http://code.google.com/p/go/issues/detail?id=227`>, probably mean that it is difficult from the the use of existing fork a thread out, because there is no simple way to ensure that all the threads have used state consistency problem. +Currently, Go programs cannot cannot be run as daemon processes (for additional information, see the open issue on github [here](https://github.com/golang/go/issues/227)). It's difficult to fork existing threads in Go because there is no way of ensuring a consistent state in all threads that have been used. -But we can see some implementations daemon many online methods, such as the following two ways: +We can, however, see many attempts at implementing daemons online, such as in the two following ways; -- MarGo an implementation of the idea of using Command to run their own applications, if you really want to achieve, it is recommended that such programs +- MarGo one implementation of the concept of using `Command` to deploy applications. If you really want to daemonize your applications, it is recommended to use code similar to the following:
 	d := flag.Bool("d", false, "Whether or not to launch in the background(like a daemon)")
@@ -38,7 +38,7 @@ But we can see some implementations daemon many online methods, such as the foll
 	}
 
-- Another solution is to use the syscall, but this solution is not perfect: +- Another solution is to use `syscall`, but this solution is not perfect: ``` package main @@ -111,7 +111,7 @@ But we can see some implementations daemon many online methods, such as the foll } ``` -The above proposed two implementations Go's daemon program, but I still do not recommend you to realize this, because the official announcement has not officially support daemon, of course, the first option is more feasible for now, but it is currently open source library skynet in adopting this program do daemon. +While the two solutions above implement daemonization in Go, I still cannot recommend that you use either methods since there is no official support for daemons in Go. Notwithstanding this fact, the first option is the more feasible one, and is currently being used by some well-known open source projects like [skynet](https://github.com/skynetservices/skynet) for implementing daemons. ## Supervisord