[MERGED] osmo-ggsn[master]: ggsn: Handle SIGTERM like SIGINT and terminate

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Sep 6 07:22:56 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: ggsn: Handle SIGTERM like SIGINT and terminate
......................................................................


ggsn: Handle SIGTERM like SIGINT and terminate

Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289
---
M ggsn/ggsn.c
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 2bf3d7e..ee64cb9 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -657,6 +657,7 @@
 	LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s);
 	switch (s) {
 	case SIGINT:
+	case SIGTERM:
 		LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n");
 		end = 1;
 		break;
@@ -803,11 +804,12 @@
 	struct ggsn_ctx *ggsn;
 	int rc;
 
-	/* Handle keyboard interrupt SIGINT */
 	tall_ggsn_ctx = talloc_named_const(NULL, 0, "openggsn");
 	msgb_talloc_ctx_init(tall_ggsn_ctx, 0);
 
+	/* Handle keyboard interrupt SIGINT */
 	signal(SIGINT, &signal_handler);
+	signal(SIGTERM, &signal_handler);
 	signal(SIGABRT, &signal_handler);
 	signal(SIGUSR1, &signal_handler);
 	signal(SIGUSR2, &signal_handler);

-- 
To view, visit https://gerrit.osmocom.org/3859
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c8773bd6ef41332b91b5b025aef9ef129af8289
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list