From 9156c417eb8136f4ee497c4893174236e1a3215d Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 4 Aug 2025 14:16:32 +0530 Subject: [PATCH 1/7] Update rrdMain.c --- src/rrdMain.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rrdMain.c b/src/rrdMain.c index 53721e0d1..ac2d1f3a4 100644 --- a/src/rrdMain.c +++ b/src/rrdMain.c @@ -97,6 +97,16 @@ bool isRRDEnabled(void) if (strcasecmp("false", param.value) == 0) { ret = false; } + else { + const char *filePath = "/tmp/rrd_enabled"; + ILE *fp = fopen(filePath, "w"); + if (fp) { + fclose(fp); + RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]:RRD is enabled, touched file %s\n", __FUNCTION__, __LINE__, filePath); + } + else { + RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]:Failed to touch file %s\n", __FUNCTION__, __LINE__, filePath); + } } else { RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:ERROR in getRFCParameter()\n", __FUNCTION__, __LINE__); From 8be889d000f49e7a0237ca4a69b9a078ce2e89cf Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 4 Aug 2025 23:29:28 +0530 Subject: [PATCH 2/7] Update rrdMain.c --- src/rrdMain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rrdMain.c b/src/rrdMain.c index ac2d1f3a4..6f96b7041 100644 --- a/src/rrdMain.c +++ b/src/rrdMain.c @@ -99,7 +99,7 @@ bool isRRDEnabled(void) } else { const char *filePath = "/tmp/rrd_enabled"; - ILE *fp = fopen(filePath, "w"); + FILE *fp = fopen(filePath, "w"); if (fp) { fclose(fp); RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]:RRD is enabled, touched file %s\n", __FUNCTION__, __LINE__, filePath); @@ -107,6 +107,7 @@ bool isRRDEnabled(void) else { RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]:Failed to touch file %s\n", __FUNCTION__, __LINE__, filePath); } + } } else { RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:ERROR in getRFCParameter()\n", __FUNCTION__, __LINE__); From 91acc73e1136799580372e31aca2bd69b949a65d Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Tue, 5 Aug 2025 18:58:57 +0530 Subject: [PATCH 3/7] Update rrdMain.c --- src/rrdMain.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/rrdMain.c b/src/rrdMain.c index 6f96b7041..b0a271bbf 100644 --- a/src/rrdMain.c +++ b/src/rrdMain.c @@ -97,6 +97,7 @@ bool isRRDEnabled(void) if (strcasecmp("false", param.value) == 0) { ret = false; } + /* else { const char *filePath = "/tmp/rrd_enabled"; FILE *fp = fopen(filePath, "w"); @@ -108,6 +109,7 @@ bool isRRDEnabled(void) RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]:Failed to touch file %s\n", __FUNCTION__, __LINE__, filePath); } } + */ } else { RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:ERROR in getRFCParameter()\n", __FUNCTION__, __LINE__); @@ -165,6 +167,16 @@ int main(int argc, char *argv[]) } RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:Starting RDK Remote Debugger Daemon \n",__FUNCTION__,__LINE__); + + const char *filePath = "/tmp/rrd_enabled"; + FILE *fp = fopen(filePath, "w"); + if (fp) { + fclose(fp); + RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]:RRD is enabled, touched file %s\n", __FUNCTION__, __LINE__, filePath); + } + else { + RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]:Failed to touch file %s\n", __FUNCTION__, __LINE__, filePath); + } if ((msqid = msgget(key, IPC_CREAT | 0666 )) < 0) { RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]:Message Queue ID Creation failed, msqid=%d!!!\n",__FUNCTION__,__LINE__,msqid); From 85087e28f5cd06a4401a1b317f4919715cbd52e5 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Thu, 7 Aug 2025 20:16:34 +0530 Subject: [PATCH 4/7] Update rrdMain.c --- src/rrdMain.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/rrdMain.c b/src/rrdMain.c index b0a271bbf..687db05a1 100644 --- a/src/rrdMain.c +++ b/src/rrdMain.c @@ -158,16 +158,6 @@ int main(int argc, char *argv[]) #endif /* Initialize Cache */ initCache(); - - /* Check RRD Enable RFC */ - bool isEnabled = isRRDEnabled(); - if(!isEnabled) { - RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:RFC is disabled, stopping remote-debugger\n", __FUNCTION__, __LINE__); - exit(0); - } - - RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:Starting RDK Remote Debugger Daemon \n",__FUNCTION__,__LINE__); - const char *filePath = "/tmp/rrd_enabled"; FILE *fp = fopen(filePath, "w"); if (fp) { @@ -177,6 +167,15 @@ int main(int argc, char *argv[]) else { RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]:Failed to touch file %s\n", __FUNCTION__, __LINE__, filePath); } + /* Check RRD Enable RFC */ + bool isEnabled = isRRDEnabled(); + if(!isEnabled) { + RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:RFC is disabled, stopping remote-debugger\n", __FUNCTION__, __LINE__); + exit(0); + } + + RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:Starting RDK Remote Debugger Daemon \n",__FUNCTION__,__LINE__); + if ((msqid = msgget(key, IPC_CREAT | 0666 )) < 0) { RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]:Message Queue ID Creation failed, msqid=%d!!!\n",__FUNCTION__,__LINE__,msqid); From 742d671b895cf45d92066dfcd2fde66fe2898b7f Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Sun, 10 Aug 2025 21:32:30 +0530 Subject: [PATCH 5/7] Update rrdMain.c --- src/rrdMain.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/rrdMain.c b/src/rrdMain.c index 687db05a1..ecca171b8 100644 --- a/src/rrdMain.c +++ b/src/rrdMain.c @@ -93,10 +93,24 @@ bool isRRDEnabled(void) RFC_ParamData_t param; WDMP_STATUS status = getRFCParameter("RDKRemoteDebugger", RRD_RFC, ¶m); if(status == WDMP_SUCCESS || status == WDMP_ERR_DEFAULT_VALUE) { + const char *filePath = "/tmp/rrd_enabled"; + FILE *fp = fopen(filePath, "w"); RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:getRFCParameter() name=%s,type=%d,value=%s\n", __FUNCTION__, __LINE__, param.name, param.type, param.value); + if (fp) { + fprintf(fp, "%s\n", param.value); // Write the RFC parameter value + fclose(fp); + RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Wrote '%s' to file %s\n", __FUNCTION__, __LINE__, param.value, filePath); + } + else { + RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Failed to open file %s for writing\n", __FUNCTION__, __LINE__, filePath); + } if (strcasecmp("false", param.value) == 0) { + ret = false; } + + + /* else { const char *filePath = "/tmp/rrd_enabled"; @@ -158,15 +172,6 @@ int main(int argc, char *argv[]) #endif /* Initialize Cache */ initCache(); - const char *filePath = "/tmp/rrd_enabled"; - FILE *fp = fopen(filePath, "w"); - if (fp) { - fclose(fp); - RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]:RRD is enabled, touched file %s\n", __FUNCTION__, __LINE__, filePath); - } - else { - RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]:Failed to touch file %s\n", __FUNCTION__, __LINE__, filePath); - } /* Check RRD Enable RFC */ bool isEnabled = isRRDEnabled(); if(!isEnabled) { From 90f105211929175461569fce30ce72e33b63a5bb Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Tue, 12 Aug 2025 23:22:23 +0530 Subject: [PATCH 6/7] Update rrdMain.c --- src/rrdMain.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/rrdMain.c b/src/rrdMain.c index ecca171b8..e911335b0 100644 --- a/src/rrdMain.c +++ b/src/rrdMain.c @@ -108,22 +108,6 @@ bool isRRDEnabled(void) ret = false; } - - - - /* - else { - const char *filePath = "/tmp/rrd_enabled"; - FILE *fp = fopen(filePath, "w"); - if (fp) { - fclose(fp); - RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]:RRD is enabled, touched file %s\n", __FUNCTION__, __LINE__, filePath); - } - else { - RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]:Failed to touch file %s\n", __FUNCTION__, __LINE__, filePath); - } - } - */ } else { RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]:ERROR in getRFCParameter()\n", __FUNCTION__, __LINE__); From 2bd5e6687161671573b58252cbe56168560983fa Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 18 Aug 2025 18:16:06 +0530 Subject: [PATCH 7/7] Update rrdMain.c --- src/rrdMain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rrdMain.c b/src/rrdMain.c index e911335b0..dbe402fa1 100644 --- a/src/rrdMain.c +++ b/src/rrdMain.c @@ -99,10 +99,10 @@ bool isRRDEnabled(void) if (fp) { fprintf(fp, "%s\n", param.value); // Write the RFC parameter value fclose(fp); - RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Wrote '%s' to file %s\n", __FUNCTION__, __LINE__, param.value, filePath); + RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Wrote '%s' to file %s\n", __FUNCTION__, __LINE__, param.value, filePath); } else { - RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Failed to open file %s for writing\n", __FUNCTION__, __LINE__, filePath); + RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Failed to open file %s for writing\n", __FUNCTION__, __LINE__, filePath); } if (strcasecmp("false", param.value) == 0) {