File: einhorn.go

package info (click to toggle)
golang-github-zenazn-goji 1.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 464 kB
  • sloc: makefile: 3
file content (21 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (3)
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)
}