mirror of https://github.com/perkeep/perkeep.git
devcam server: handle SIGQUIT
Somehow forgot last patch when doing http://camlistore.org/r/452 Change-Id: I10841ebff29689af19773e8f9d99c5c16659cfc1
This commit is contained in:
parent
3239048566
commit
477bf96f33
|
@ -317,7 +317,7 @@ func (c *serverCmd) setFullClosure() error {
|
|||
|
||||
func handleKillCamliSignal(camliProc *os.Process) {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, syscall.SIGTERM, syscall.SIGINT)
|
||||
signal.Notify(c, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
|
||||
for {
|
||||
sig := <-c
|
||||
sysSig, ok := sig.(syscall.Signal)
|
||||
|
@ -325,8 +325,8 @@ func handleKillCamliSignal(camliProc *os.Process) {
|
|||
log.Fatal("Not a unix signal")
|
||||
}
|
||||
switch sysSig {
|
||||
case syscall.SIGTERM, syscall.SIGINT:
|
||||
log.Print("Received kill signal, terminating.")
|
||||
case syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT:
|
||||
log.Printf("Received %v signal, terminating.", sig)
|
||||
err := camliProc.Kill()
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to kill camli: %v ", err)
|
||||
|
|
Loading…
Reference in New Issue