Skip to content

RDKEMW-22632: Order service start after PowerManager - #327

Merged
karuna2git merged 3 commits into
developfrom
topic/RDKEMW-21821
Jul 31, 2026
Merged

RDKEMW-22632: Order service start after PowerManager#327
karuna2git merged 3 commits into
developfrom
topic/RDKEMW-21821

Conversation

@Anand73-n

Copy link
Copy Markdown
Contributor

Reason for change: Ensure PowerManager service is started before NetworkManager
Test procedure: Reboot, then inspect the order units actually started
Risks: low
Priority: P1

Copilot AI review requested due to automatic review settings July 22, 2026 14:34
@Anand73-n
Anand73-n requested a review from a team as a code owner July 22, 2026 14:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 a systemd drop-in to ensure wpeframework-networkmanager.service is ordered after wpeframework-powermanager.service, so PowerManager is started first on boot in GNOME-enabled builds.

Changes:

  • Add a systemd drop-in setting After= and Wants= for wpeframework-powermanager.service.
  • Install the new drop-in into wpeframework-networkmanager.service.d via the plugin CMake install rules.

Reviewed changes

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

File Description
plugin/gnome/systemd/gnome-powermanager-dependency.conf Introduces the systemd unit drop-in to order NetworkManager after PowerManager and pull it in.
plugin/CMakeLists.txt Installs the new drop-in alongside existing NetworkManager systemd drop-ins when ENABLE_GNOME_NETWORKMANAGER is enabled.

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

@Anand73-n
Anand73-n force-pushed the topic/RDKEMW-21821 branch from 6add70f to e0485e4 Compare July 22, 2026 14:36
Copilot AI review requested due to automatic review settings July 22, 2026 14:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread plugin/gnome/systemd/gnome-powermanager-dependency.conf Outdated
Copilot AI review requested due to automatic review settings July 22, 2026 15:04
@Anand73-n
Anand73-n force-pushed the topic/RDKEMW-21821 branch from e0485e4 to 6fa89ab Compare July 22, 2026 15:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 no new comments.

Comments suppressed due to low confidence (1)

plugin/gnome/systemd/gnome-powermanager-dependency.conf:3

  • After= only enforces ordering when both units are already part of the same transaction; it does not ensure wpeframework-powermanager.service is started. If the goal is to ensure PowerManager is started before NetworkManager, add a dependency like Wants= (or Requires= if NetworkManager cannot function without it) alongside After=.
[Unit]
# Ensure NetworkManager starts after PowerManager
After=wpeframework-powermanager.service

@Anand73-n
Anand73-n force-pushed the topic/RDKEMW-21821 branch from 6fa89ab to ecb654a Compare July 22, 2026 15:51
Copilot AI review requested due to automatic review settings July 22, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

plugin/gnome/systemd/gnome-powermanager-dependency.conf:3

  • After= only enforces ordering if both units are started; it does not pull in/activate PowerManager. If the goal is to ensure PowerManager is started before this service, add a dependency (e.g., Wants= or Requires=) alongside After= so systemd will start PowerManager when NetworkManager is started.
[Unit]
# Ensure NetworkManager starts after PowerManager
After=wpeframework-powermanager.service

Comment thread plugin/NetworkManagerPowerClient.cpp
Reason for change: Ensure PowerManager service is started before NetworkManager
Test procedure: Reboot, then inspect the order units actually started
Risks: low
Priority: P1

Signed-off-by: Anand N <Anand_N@comcast.com>
Copilot AI review requested due to automatic review settings July 22, 2026 16:08
@Anand73-n
Anand73-n force-pushed the topic/RDKEMW-21821 branch from ecb654a to 3f3c55f Compare July 22, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread plugin/gnome/systemd/nm-powermanager.conf
@Anand73-n Anand73-n changed the title RDKEMW-21821: Order service start after PowerManager RDKEMW-22632: Order service start after PowerManager Jul 29, 2026
karuna2git
karuna2git previously approved these changes Jul 31, 2026
Copilot AI review requested due to automatic review settings July 31, 2026 18:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (2)

plugin/gnome/systemd/nm-powermanager.conf:3

  • The new drop-in only adds an ordering dependency (After=). This does not ensure the PowerManager unit is actually started before NetworkManager; it only affects ordering if both are already scheduled to start. If the intent is to make sure PowerManager is brought up first on boot, add a Wants= (or Requires=) on the PowerManager unit in addition to After=.
[Unit]
# Ensure NetworkManager starts after PowerManager
After=wpeframework-powermanager.service

plugin/NetworkManagerPowerClient.cpp:41

  • The constructor logging was changed from an action-oriented message to generic "ctor"/"ctor ends" lines. This is less informative in logs and adds an extra log line on every construction. Consider logging the actual connect attempt and (on success) the connection result, and drop the redundant "ctor ends" message.
    NMLOG_INFO("NetworkManagerPowerClient ctor");
    if (auto r = Open(RPC::CommunicationTimeOut, Connector(), "org.rdk.PowerManager"); r == Core::ERROR_NONE) {
        // Connected; Operational() will be called by the framework when the proxy is ready
    } else {
        NMLOG_ERROR("failed to open link to PowerManager (error %u)", r);

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 31, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (2)

plugin/NetworkManagerPowerClient.cpp:43

  • The new INFO logs in the constructor are less actionable than the previous "connecting to PowerManager" message and add extra noise ("ctor" + "ctor ends"), including logging "ctor ends" even when Open() fails. Consider keeping a single, descriptive log line for the connection attempt instead of start/end markers.
    NMLOG_INFO("NetworkManagerPowerClient ctor");
    if (auto r = Open(RPC::CommunicationTimeOut, Connector(), "org.rdk.PowerManager"); r == Core::ERROR_NONE) {
        // Connected; Operational() will be called by the framework when the proxy is ready
    } else {
        NMLOG_ERROR("failed to open link to PowerManager (error %u)", r);
    }
    NMLOG_INFO("NetworkManagerPowerClient ctor ends");

plugin/gnome/systemd/nm-powermanager.conf:3

  • Using Wants= means NetworkManager will still start even if wpeframework-powermanager.service fails to start; this weakens the "ensure PowerManager starts before NetworkManager" guarantee (ordering is enforced, but dependency failure is not). If PowerManager must be present/healthy before NetworkManager starts, prefer Requires= (keeping After=).
Wants=wpeframework-powermanager.service

@karuna2git
karuna2git merged commit 96eb081 into develop Jul 31, 2026
19 of 20 checks passed
@karuna2git
karuna2git deleted the topic/RDKEMW-21821 branch July 31, 2026 19:11
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants