summaryrefslogtreecommitdiffhomepage
path: root/gobgpd/main.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-06 15:29:56 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-06 15:29:56 +0900
commit87a71be40f37a3d39e56d8452bcf122a6b5ce422 (patch)
tree773fd742441807a4ecc4114c607eab2a9076dd47 /gobgpd/main.go
parenta79e962dea57be0904d95be9bf5de39ff24409d1 (diff)
server: support to send notification to all peers when shutdown
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'gobgpd/main.go')
-rw-r--r--gobgpd/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go
index 7a3b3ef2..307372f1 100644
--- a/gobgpd/main.go
+++ b/gobgpd/main.go
@@ -35,7 +35,7 @@ func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
sigCh := make(chan os.Signal, 1)
- signal.Notify(sigCh, syscall.SIGHUP)
+ signal.Notify(sigCh, syscall.SIGHUP, syscall.SIGTERM)
var opts struct {
ConfigFile string `short:"f" long:"config-file" description:"specifying a config file"`
@@ -206,6 +206,8 @@ func main() {
case syscall.SIGHUP:
log.Info("reload the config file")
reloadCh <- true
+ case syscall.SIGKILL, syscall.SIGTERM:
+ bgpServer.Shutdown()
}
}
}