Codebase list golang-github-zenazn-goji / run/320db3f7-236d-4be4-b1f5-2a2fdc596d69/main graceful / einhorn.go
run/320db3f7-236d-4be4-b1f5-2a2fdc596d69/main

Tree @run/320db3f7-236d-4be4-b1f5-2a2fdc596d69/main (Download .tar.gz)

einhorn.go @run/320db3f7-236d-4be4-b1f5-2a2fdc596d69/mainraw · history · blame

// +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)
}