Skip to content

Topic/rdkb 63981#30

Open
Lasya-Prakarsha-D-V wants to merge 12 commits intodevelopfrom
topic/RDKB-63981
Open

Topic/rdkb 63981#30
Lasya-Prakarsha-D-V wants to merge 12 commits intodevelopfrom
topic/RDKB-63981

Conversation

@Lasya-Prakarsha-D-V
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings April 21, 2026 10:47
@Lasya-Prakarsha-D-V Lasya-Prakarsha-D-V requested a review from a team as a code owner April 21, 2026 10:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates RFC service startup behavior and related maintenance-window trigger logic, likely to improve observability and/or timing of rfcMgr execution.

Changes:

  • Added start/end timestamp logs in rfc.service, plus additional delay and logging around rfcMgr launch.
  • Disabled (commented out) the RFC service invocation from fileUploadRandom.sh.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
rfc.service Adds timestamp logs and introduces additional sleep/log statements around rfcMgr startup.
fileUploadRandom.sh Comments out the call that launches rfc.service during the maintenance-window flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rfc.service
Comment on lines 48 to 52
if [ "x$BOX_TYPE" == "xTCCBR" ]; then
sleep 300
fi
echo "RFC MGR is called here ... : $(date)"
/usr/bin/rfcMgr &
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new unconditional sleep 300 means every platform will delay RFC startup by 5 minutes, and BOX_TYPE=TCCBR will now sleep twice (total 600s). If the delay is only needed for TCCBR, keep it inside that conditional; otherwise make the delay configurable and avoid doubling it for TCCBR.

Copilot uses AI. Check for mistakes.
Comment thread rfc.service
fi
echo "RFC MGR is called here ... : $(date)"
/usr/bin/rfcMgr &
echo "RFC MGR execution finished here ... : $(date)"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/bin/rfcMgr is started in the background, so the log line "RFC MGR execution finished" will print immediately even though the process hasn't finished. Consider either not backgrounding it (and logging based on exit status) or change the message to indicate it was started/launched.

Suggested change
echo "RFC MGR execution finished here ... : $(date)"
echo "RFC MGR launched in background here ... : $(date)"

Copilot uses AI. Check for mistakes.
Comment thread rfc.service
##########################################################################
#

echo "RFC service START ing here ...: $(date)"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log text has awkward spacing/grammar ("START ing"). Please adjust to a single word (e.g., "STARTING") to keep logs searchable and consistent.

Copilot uses AI. Check for mistakes.
Comment thread rfc.service
echo "RFC MGR execution finished here ... : $(date)"
fi

echo "RFC service END ing here ... : $(date)"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log text has awkward spacing/grammar ("END ing"). Please adjust to a single word (e.g., "ENDING") to keep logs searchable and consistent.

Suggested change
echo "RFC service END ing here ... : $(date)"
echo "RFC service ENDING here ... : $(date)"

Copilot uses AI. Check for mistakes.
Comment thread fileUploadRandom.sh
Comment on lines 253 to 255
# Enable RFC feature
if [ -f $DCM_PATH/rfc.service ]; then
echo_t "RDK Logger : Starting RFC service from fileUploadRandom.sh"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block logs "Starting RFC service" but the actual invocation is commented out, so RFC will never be started from this path. Either re-enable the command (if RFC is still required in the maintenance window) or change the log/comment and explicitly document/handle the new behavior so it’s not silently disabled.

Suggested change
# Enable RFC feature
if [ -f $DCM_PATH/rfc.service ]; then
echo_t "RDK Logger : Starting RFC service from fileUploadRandom.sh"
# RFC service startup from fileUploadRandom.sh is currently disabled.
if [ -f $DCM_PATH/rfc.service ]; then
echo_t "RDK Logger : RFC service file present, but startup from fileUploadRandom.sh is disabled"
# Intentionally not starting RFC service from this path.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 21, 2026 10:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rfc.service
sleep 300
echo "RFC MGR is called here ... : $(date)"
/usr/bin/rfcMgr &
echo "RFC MGR execution finished here ... : $(date)"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/bin/rfcMgr is started in the background, so this "execution finished" log will print immediately even though the process is still running. Either remove backgrounding and wait, or change the message to something accurate like "started"/"spawned".

Suggested change
echo "RFC MGR execution finished here ... : $(date)"
echo "RFC MGR started in background here ... : $(date)"

Copilot uses AI. Check for mistakes.
Comment thread rfc.service
echo "RFC MGR execution finished here ... : $(date)"
fi

echo "RFC service END ing here ... : $(date)"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log message has an odd split word ("END ing"), which reads like a typo and makes log searching inconsistent with typical "ENDING" wording. Consider changing it to "ENDING".

Suggested change
echo "RFC service END ing here ... : $(date)"
echo "RFC service ENDING here ... : $(date)"

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 21, 2026 10:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rfc.service
echo "RFC MGR execution finished here ... : $(date)"
fi

echo "RFC service END ing here ... : $(date)"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling/wording: "RFC service END ing here ..." reads oddly in logs. Consider "RFC service ending..." / "ended...".

Suggested change
echo "RFC service END ing here ... : $(date)"
echo "RFC service ended here ... : $(date)"

Copilot uses AI. Check for mistakes.
Comment thread rfc.service
##########################################################################
#

echo "RFC service START ing here ...: $(date)"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling/wording in the new log messages is awkward ("START ing" / "END ing"). Consider changing these to "starting" / "ending" (or "started" / "ended") for clearer logs.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 21, 2026 10:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 22, 2026 07:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rfc.service
Comment on lines +80 to +84
echo "RFC MGR is called here ... : $(date)"
/usr/bin/rfcMgr &
echo "RFC MGR execution finished here ... : $(date)"
fi

echo "RFC service END ing here ... : $(date)"
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/bin/rfcMgr is started in the background (&), but the subsequent messages say “execution finished” and the script prints “RFC service END…”. This is misleading because the manager is still running. Either change the messages to indicate it was launched (or capture/print the child PID), or wait for completion if you truly want to log when it finishes.

Copilot uses AI. Check for mistakes.
Comment thread fileUploadRandom.sh Outdated
if [ -f $DCM_PATH/rfc.service ]; then
echo_t "RDK Logger : Starting RFC service from fileUploadRandom.sh"
sh $DCM_PATH/rfc.service &
#sh $DCM_PATH/rfc.service &
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script logs “Starting RFC service…” but the actual invocation is commented out (#sh $DCM_PATH/rfc.service &). As-is, RFC is never started from this path, which contradicts “Enable RFC feature” and will likely disable expected behavior. Either restore the invocation, or update the log message/comment and ensure RFC is started elsewhere.

Suggested change
#sh $DCM_PATH/rfc.service &
sh $DCM_PATH/rfc.service &

Copilot uses AI. Check for mistakes.
Comment thread rfc.service
Comment on lines +21 to 22
LOG=/rdklogs/logs/rfc_trace.log

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG is hard-coded to /rdklogs/logs/rfc_trace.log before LOG_PATH is computed later in the script. On non-broadband devices LOG_PATH is set to /opt/logs, so this trace log may fail to open (and you lose the invocation trace). Consider deriving LOG from the same LOG_PATH logic (or checking/creating the directory) so logging works consistently across device types.

Copilot uses AI. Check for mistakes.
Comment thread rfc.service Outdated
Comment on lines +47 to +48
echo
} >> $LOG 2>&1
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The redirection appends to $LOG without quoting or ensuring the directory/file is writable. If the log directory is missing (or permissions differ), the whole grouped command’s redirection will fail and the trace won’t be captured. Quote $LOG and ensure the parent directory exists (e.g., mkdir -p "$(dirname ...)") before writing.

Copilot uses AI. Check for mistakes.
Comment thread rfc.service Outdated
Comment on lines +28 to +32
echo "PID=$$ PPID=$PPID"
echo "CMD=$(tr '\0' ' ' < /proc/$$/cmdline)"

echo "--- PARENT ---"
echo "CMD=$(tr '\0' ' ' < /proc/$PPID/cmdline 2>/dev/null)"
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trace block logs full process cmdlines (from /proc/*/cmdline) and selected environment variables into a persistent log file. Cmdlines/env commonly contain sensitive tokens/URLs/credentials, which could be exposed via log collection. Please gate this behind an explicit debug/RFC flag, or redact known-sensitive patterns before writing.

Copilot uses AI. Check for mistakes.
Comment thread rfc.service
while [ "$pid" -gt 1 ]; do
cmd=$(tr '\0' ' ' < /proc/$pid/cmdline 2>/dev/null)
echo "PID=$pid CMD=$cmd"
pid=$(awk '{print $4}' /proc/$pid/stat 2>/dev/null)
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pid can become empty/non-numeric if /proc/$pid/stat can’t be read, which will cause [ "$pid" -gt 1 ] to emit an “integer expression” error into the log. Consider breaking the loop when the parent pid can’t be parsed (or validating that pid is numeric) to keep the trace clean and predictable.

Suggested change
pid=$(awk '{print $4}' /proc/$pid/stat 2>/dev/null)
next_pid=$(awk '{print $4}' /proc/$pid/stat 2>/dev/null)
case "$next_pid" in
''|*[!0-9]*)
break
;;
esac
pid=$next_pid

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 22, 2026 07:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rfc.service
Comment on lines +21 to +25
LOG=/rdklogs/logs/rfc_trace.log

log() {
echo "$(date '+%Y-%m-%d %H:%M:%S.%3N') | $*" >> "$LOG"
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG is hardcoded to /rdklogs/logs/rfc_trace.log and logging is performed before LOG_PATH is derived from DEVICE_TYPE. This can write to the wrong location (e.g., non-broadband uses /opt/logs) or fail if the directory doesn't exist. Consider setting LOG based on LOG_PATH after sourcing properties and ensuring the log directory exists before writing.

Copilot uses AI. Check for mistakes.
Comment thread rfc.service
fi
echo "RFC MGR is called here ... : $(date)"
/usr/bin/rfcMgr &
echo "RFC MGR execution finished here ... : $(date)"
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/bin/rfcMgr is started in the background (&), but the next line logs "RFC MGR execution finished" immediately even though rfcMgr may still be running. Either wait for the process (remove & / wait) or change the message to indicate it was started/spawned.

Suggested change
echo "RFC MGR execution finished here ... : $(date)"
echo "RFC MGR started in background here ... : $(date)"

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 22, 2026 07:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants