aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/zenazn/goji/graceful/einhorn.go
blob: 082d1c48625745639c93d9c84e53746edf4f59ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
}