diff options
Diffstat (limited to 'vendor/github.com/zenazn/goji/graceful/einhorn.go')
| -rw-r--r-- | vendor/github.com/zenazn/goji/graceful/einhorn.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/github.com/zenazn/goji/graceful/einhorn.go b/vendor/github.com/zenazn/goji/graceful/einhorn.go new file mode 100644 index 0000000..082d1c4 --- /dev/null +++ b/vendor/github.com/zenazn/goji/graceful/einhorn.go @@ -0,0 +1,21 @@ +// +build !windows + +package graceful + +import ( + "os" + "strconv" + "syscall" +) + +func init() { + // This is a little unfortunate: goji/bind already knows whether we're + // running under einhorn, but we don't want to introduce a dependency + // between the two packages. Since the check is short enough, inlining + // it here seems "fine." + mpid, err := strconv.Atoi(os.Getenv("EINHORN_MASTER_PID")) + if err != nil || mpid != os.Getppid() { + return + } + stdSignals = append(stdSignals, syscall.SIGUSR2) +} |
