Skip to content
Open
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: 4 additions & 3 deletions systemd_units/rfc.service
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ Description=RFC service

[Service]
Type=oneshot
ExecStartPre=/bin/sh -c 'sleep 300'
ExecStartPre=/bin/sh -c 'echo "RFC execPre START: $(date)"; sleep 300; echo "RFC execPre END: $(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.

ExecStartPre is doing three actions (log, sleep, log) via a shell -c string. For systemd units this is harder to reason about and makes it difficult to adjust timeouts/ordering later. Consider splitting this into multiple ExecStartPre= directives (systemd runs them sequentially) and/or using native commands (e.g., ExecStartPre=/bin/sleep 300) so each step is separately visible and failure behavior is clearer.

Suggested change
ExecStartPre=/bin/sh -c 'echo "RFC execPre START: $(date)"; sleep 300; echo "RFC execPre END: $(date)"'
ExecStartPre=/bin/sh -c 'echo "RFC execPre START: $(date)"'
ExecStartPre=/bin/sleep 300
ExecStartPre=/bin/sh -c 'echo "RFC execPre END: $(date)"'

Copilot uses AI. Check for mistakes.
EnvironmentFile=/etc/device.properties
ExecStart=/bin/sh -c 'echo "Enable RFC feature" >> ${PARODUS_START_LOG_FILE}'
ExecStart=/bin/sh -c '/lib/rdk/rfc.service &'
ExecStart=/bin/sh -c 'echo " $(date) Enable RFC feature" >> ${PARODUS_START_LOG_FILE}'
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

The log line being appended includes a leading space before the timestamp (" $(date) ..."), which makes log parsing/grepping inconsistent and looks accidental. Trim the leading space (and consider matching the repository’s common date: log format used in other unit scripts).

Suggested change
ExecStart=/bin/sh -c 'echo " $(date) Enable RFC feature" >> ${PARODUS_START_LOG_FILE}'
ExecStart=/bin/sh -c 'echo "$(date) Enable RFC feature" >> ${PARODUS_START_LOG_FILE}'

Copilot uses AI. Check for mistakes.
ExecStart=/bin/sh -c 'echo "SYSTEMD CALL $(date)" >> /rdklogs/logs/rfc_trace.log'
ExecStart=/bin/sh -c 'echo "RFC execStart START: $(date)"; /lib/rdk/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.

Running the main service script in the background ('&') under Type=oneshot means systemd won’t reliably track the long-running process, and the unit can report success even if /lib/rdk/rfc.service fails immediately. Prefer letting systemd manage the process directly (e.g., Type=simple with ExecStart=/lib/rdk/rfc.service, or Type=forking with a PIDFile if it daemonizes) so restarts/status reflect the real process state.

Copilot uses AI. Check for mistakes.
RemainAfterExit=yes


Expand Down
Loading