RDKEMW-22632: Order service start after PowerManager - #327
Conversation
There was a problem hiding this comment.
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=andWants=forwpeframework-powermanager.service. - Install the new drop-in into
wpeframework-networkmanager.service.dvia 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.
6add70f to
e0485e4
Compare
e0485e4 to
6fa89ab
Compare
There was a problem hiding this comment.
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 ensurewpeframework-powermanager.serviceis started. If the goal is to ensure PowerManager is started before NetworkManager, add a dependency likeWants=(orRequires=if NetworkManager cannot function without it) alongsideAfter=.
[Unit]
# Ensure NetworkManager starts after PowerManager
After=wpeframework-powermanager.service
6fa89ab to
ecb654a
Compare
There was a problem hiding this comment.
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=orRequires=) alongsideAfter=so systemd will start PowerManager when NetworkManager is started.
[Unit]
# Ensure NetworkManager starts after PowerManager
After=wpeframework-powermanager.service
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>
ecb654a to
3f3c55f
Compare
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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
Reason for change: Ensure PowerManager service is started before NetworkManager
Test procedure: Reboot, then inspect the order units actually started
Risks: low
Priority: P1