Skip to content

Conversation

@Abhinavpv28
Copy link

No description provided.

Copilot AI review requested due to automatic review settings December 29, 2025 13:26
@Abhinavpv28 Abhinavpv28 requested a review from a team as a code owner December 29, 2025 13:26
Copy link

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

This PR adds support for a new binary-based log upload tool (/usr/bin/logupload) with automatic fallback to the existing script-based implementation. The change enables the system to try the binary implementation first, and if it fails or is unavailable, fall back to the original shell script approach.

  • Introduces a new LOG_UPLOAD_BIN_PATH variable to specify the binary location
  • Implements try-binary-first, fallback-to-script logic in both on-demand and regular log upload paths
  • Adds detailed logging for binary execution success/failure and fallback behavior

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 29, 2025 13:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

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 5 comments.


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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 29, 2025 13:37
Copy link

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 4 comments.


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

Copilot AI review requested due to automatic review settings January 1, 2026 12:19
Copy link

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 1 comment.


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

Comment on lines 200 to 209
nice -n 19 "$LOG_UPLOAD_BIN_PATH" "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" & >> /opt/logs/dcmscript.log
bg_pid=$!
wait $bg_pid
result=$?
if [ "$result" -eq 0 ]; then
logUploadLog "Binary execution succeeded"
return 0
else
logUploadLog "Binary execution failed with result=$result; falling back to script"
nice -n 19 sh $LOGUPLOAD_SCRIPT "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" &
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The binary call is missing the trigger type argument that the script receives. Looking at line 181, the binary gets 7 arguments ending with "ondemand", but at line 209, the script gets 6 arguments (no trigger type). The regular execution path should pass a trigger type to maintain consistency, or omit it from the binary call on line 200 as well if it's not needed for regular execution.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 1, 2026 18:47
Copy link

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 1 comment.


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

result=$?
if [ -x "$LOG_UPLOAD_BIN_PATH" ]; then
logUploadLog "Executing logupload binary: $LOG_UPLOAD_BIN_PATH"
"$LOG_UPLOAD_BIN_PATH" "$tftp_server" 1 1 "$uploadOnReboot" "$upload_protocol" "$upload_httplink" "ondemand" >> /opt/logs/dcmscript.log
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The TriggerType parameter is being passed inconsistently. In the binary execution, it's passed as the string "ondemand" (line 181), but in the fallback script execution and the else branch, it's passed as the variable "$TriggerType" (lines 188, 193). This inconsistency could lead to different behavior between the binary and script executions.

Copilot uses AI. Check for mistakes.
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.

3 participants