Compare commits
2 Commits
v1.0
...
b36f1fd7d7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b36f1fd7d7 | ||
|
|
87361a4e6c |
5
main.go
5
main.go
@@ -112,7 +112,10 @@ func main() {
|
||||
go sigHandler()
|
||||
signal.Notify(sigChan,
|
||||
syscall.SIGUSR1,
|
||||
syscall.SIGUSR2)
|
||||
syscall.SIGUSR2,
|
||||
syscall.SIGQUIT,
|
||||
syscall.SIGTERM,
|
||||
syscall.SIGINT)
|
||||
|
||||
// Populate memory stats
|
||||
if Conf.Mem.Enabled {
|
||||
|
||||
@@ -25,6 +25,9 @@ func sigHandler() {
|
||||
|
||||
UpdateReady <- true
|
||||
|
||||
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
|
||||
os.Exit(0)
|
||||
|
||||
// We have signal that we're not interested in, so make a new loop iteration.
|
||||
default:
|
||||
continue
|
||||
|
||||
2
spawn.go
2
spawn.go
@@ -11,7 +11,7 @@ import (
|
||||
// RunChan to this channel we send command and its argv to execute as separate process.
|
||||
var RunChan = make(chan []string, 128)
|
||||
|
||||
// Spawn forks and execs given program, and also detaches form its control tty.
|
||||
// Spawner forks and execs given program, and also detaches form its control tty.
|
||||
func Spawner() {
|
||||
for prg := range RunChan {
|
||||
devnullR, _ := os.Open(os.DevNull)
|
||||
|
||||
Reference in New Issue
Block a user