Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions source/telemetry2_0.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in source/telemetry2_0.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/telemetry2_0.c' (Match: rdk/components/generic/telemetry/rdk/components/generic/telemetry/1, 370 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/telemetry/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/telemetry2_0.c)
*
* Copyright 2019 RDK Management
*
Expand Down Expand Up @@ -109,6 +109,10 @@

static void terminate()
{
struct timespec t2, t_start;
clock_gettime(CLOCK_MONOTONIC, &t_start);
T2Info("=== [SHUTDOWN] telemetry2_0 shutdown started ===\n");

if(remove("/tmp/.t2ReadyToReceiveEvents") != 0)
{
printf("removing the file /tmp/.t2ReadyToReceiveEvents failed!\n");
Expand All @@ -131,6 +135,9 @@
ReportProfiles_uninit();
http_pool_cleanup();
}
clock_gettime(CLOCK_MONOTONIC, &t2);
T2Info("=== [SHUTDOWN] telemetry2_0 shutdown complete, total=%lldms ===\n",
(long long)(t2.tv_sec - t_start.tv_sec) * 1000 + (t2.tv_nsec - t_start.tv_nsec) / 1000000LL);

}
static void _print_stack_backtrace(void)
Expand Down
4 changes: 2 additions & 2 deletions telemetry2_0.service
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Requires=network-online.target
[Service]
Type=forking
ExecStart=/usr/bin/telemetry2_0
ExecStop=/usr/bin/killall telemetry2_0
ExecStopPost=/bin/rm -rf /tmp/.t2ReadyToReceiveEvents /tmp/telemetry_initialized_bootup /tmp/.t2ConfigReady
ExecStop=/bin/sh -c 'echo "[SHUTDOWN] $(date +%%Y-%%m-%%dT%%H:%%M:%%S) telemetry2_0 stop initiated by systemd" >> /opt/logs/telemetry2_0.txt.0 2>&1; date +%%s > /tmp/.t2_stop_start 2>/dev/null; /usr/bin/killall telemetry2_0'
ExecStopPost=/bin/sh -c 'echo "[SHUTDOWN] $$(date +%%Y-%%m-%%dT%%H:%%M:%%S) telemetry2_0 stop completed" >> /opt/logs/telemetry2_0.txt.0 2>&1; rm -f /tmp/.t2_stop_start; /bin/rm -rf /tmp/.t2ReadyToReceiveEvents /tmp/telemetry_initialized_bootup /tmp/.t2ConfigReady'
Restart=always

[Install]
Expand Down
Loading