summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eric Jeong <ericjeong@google.com> 2019-10-03 13:33:48 -0700
committer Eric Jeong <ericjeong@google.com> 2019-11-11 18:18:36 +0000
commit4326effee17c8f8125e63cacfc22cad694842b3e (patch)
treec57f7505cf53487c11938145114a75806aacd689
parent2080a05995af551413b3ca9a89c55e6c1d09acd8 (diff)
Terminate statsd on a few signals including SIGTERM
- statsd is handling SIGHUP/SIGQUIT/SIGINT/SIGTERM, but doesn't exit. - The expected behaviour is that statsd would exit after finalizing log processing when those signals are received. Bug: 139817664 Test: Send SIGTERM to statsd and check if it is terminated. (note that init will revive statsd) Change-Id: Id1146d772f8c68892256ee7a3eea70837fee5c7a (cherry picked from commit 2d99718adf13eb116207abd25d05676dd2a691db) (cherry picked from commit 931811bda4e52ba74dd17121b514615f2991583f) Merged-In: Id1146d772f8c68892256ee7a3eea70837fee5c7a
-rw-r--r--cmds/statsd/src/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmds/statsd/src/main.cpp b/cmds/statsd/src/main.cpp
index 42132ee0daae..7d446a9a1ed6 100644
--- a/cmds/statsd/src/main.cpp
+++ b/cmds/statsd/src/main.cpp
@@ -53,6 +53,8 @@ void sigHandler(int sig) {
if (gStatsService != nullptr) {
gStatsService->Terminate();
}
+ ALOGW("statsd terminated on receiving signal %d.", sig);
+ exit(1);
}
void registerSigHandler()