Skip to content

Systemd service files: Add timeouts, [Install] sections, and fix dependencies#161

Draft
Copilot wants to merge 3 commits intodevelopfrom
copilot/review-systemd-service-files
Draft

Systemd service files: Add timeouts, [Install] sections, and fix dependencies#161
Copilot wants to merge 3 commits intodevelopfrom
copilot/review-systemd-service-files

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 5, 2026

Problem

52 systemd service files lacked timeout directives (risking indefinite hangs on embedded systems), [Install] sections (preventing systemctl enable), and security isolation. Four files had dependency inconsistencies.

Changes

Universal updates (all 52 files)

  • Added TimeoutStartSec=30 and TimeoutStopSec=10
  • Added [Install] section with WantedBy=multi-user.target (51 files; wpeframework-powermanager already had it)
  • Added PrivateTmp=yes for /tmp namespace isolation
  • Added header documentation
  • Cleaned trailing whitespace

Dependency fixes

  • wpeframework-bluetooth.service: Unified to btmgr.service (was mixing bluetooth.service in Requires and btmgr.service in After)
  • wpeframework-displaysettings.service: Added missing wpeframework.service dependency and ConditionPathExists=/tmp/wpeframeworkstarted
  • wpeframework-hdmicecsource.service: Added Wants= for optional dependencies to align Requires and After
  • wpeframework-ocdm.service: Documented -r 200 retry parameter

Example

+# WPEFramework Monitor Initialiser
+# Activates the Monitor plugin after framework initialization
 [Unit]
 Description=WPEFramework Monitor Initialiser
 ...
 [Service]
 Type=oneshot
 RemainAfterExit=yes
+TimeoutStartSec=30
+TimeoutStopSec=10
+PrivateTmp=yes
 ExecStart=/usr/bin/PluginActivator Monitor
+
+[Install]
+WantedBy=multi-user.target

Impact

  • Services won't hang indefinitely during boot/shutdown
  • All services now support systemctl enable
  • Improved security isolation and documentation
  • RDK Architecture compliant, systemd 230+ compatible
Original prompt

Systemd Service Files Review and Improvements

Objective

Review all systemd service files in systemd/system/ directory against RDK Architecture best practices and implement necessary fixes and improvements for systemd 230+ compatibility.

Critical Issues to Address

1. 🔴 Missing Timeout Directives (ALL FILES)

Impact: Services may hang indefinitely during start/stop, blocking boot/shutdown in embedded systems.

Required changes for ALL service files:

  • Add TimeoutStartSec=30 (or appropriate value)
  • Add TimeoutStopSec=10 (conservative value for embedded systems)
  • ⚠️ IMPORTANT: If timeout values > 90 seconds are needed, add a comment justifying the longer timeout

Example:

[Service]
# Extended timeout needed due to database initialization
TimeoutStartSec=120
TimeoutStopSec=10

2. 🔴 Service Type Best Practices

Current issue: Several files don't explicitly specify service type or could use better types.

Guidelines:

  • Prefer Type=notify or Type=oneshot over Type=simple
  • For Type=oneshot: Use RemainAfterExit=yes for state-maintaining services
  • Ensure proper ordering with Before=/After= directives

3. 🔴 Dependency Management Issues

Files with dependency concerns:

wpeframework-bluetooth.service

Requires=wpeframework.service iarmbusd.service bluetooth.service
After=wpeframework.service iarmbusd.service btmgr.service
  • Issue: Requires=bluetooth.service but After=btmgr.service - inconsistent dependency naming
  • Fix: Ensure consistency - should be either bluetooth.service or btmgr.service in both

wpeframework-displaysettings.service

Requires=dsmgr.service wpeframework-powermanager.service
After=dsmgr.service wpeframework-powermanager.service
  • Issue: Missing wpeframework.service dependency and no ConditionPathExists=/tmp/wpeframeworkstarted
  • Fix: Add wpeframework.service to Requires/After and add condition

wpeframework-hdmicecsource.service

Requires=wpeframework.service
After=wpeframework-powermanager.service dsmgr.service
  • Issue: Requires=wpeframework.service only, but After= includes additional services
  • Fix: Either add wpeframework-powermanager.service dsmgr.service to Requires= or use Wants= with proper ordering

4. ⚡ Missing [Install] Section

Files missing [Install] section with WantedBy=multi-user.target:

  • wpeframework-analytics.service
  • wpeframework-appgateway.service
  • wpeframework-appgatewaycommon.service
  • wpeframework-appmanager.service
  • wpeframework-appnotifications.service
  • wpeframework-avinput.service
  • wpeframework-avoutput.service
  • wpeframework-bluetooth.service
  • wpeframework-cloudstore.service
  • wpeframework-cryptography.service
  • wpeframework-deviceinfo.service
  • wpeframework-displayinfo.service
  • wpeframework-displaysettings.service
  • wpeframework-downloadmanager.service
  • wpeframework-firmwareupdate.service
  • wpeframework-frontpanel.service
  • wpeframework-hdcpprofile.service
  • wpeframework-hdmicecsink.service
  • wpeframework-hdmicecsource.service
  • wpeframework-lifecyclemanager.service
  • wpeframework-lisa.service
  • wpeframework-locationsync.service
  • wpeframework-maintenancemanager.service
  • wpeframework-messenger.service
  • wpeframework-migration.service
  • wpeframework-monitor.service
  • wpeframework-network.service
  • wpeframework-networkmanager.service
  • wpeframework-ocdm.service
  • wpeframework-ocicontainer.service
  • wpeframework-packagemanager.service
  • wpeframework-persistentstore.service
  • wpeframework-playerinfo.service
  • wpeframework-preinstallmanager.service
  • wpeframework-rdkshell.service
  • wpeframework-rdkwindowmanager.service
  • wpeframework-remotecontrol.service
  • wpeframework-runtimemanager.service
  • wpeframework-sharedstorage.service
  • wpeframework-storagemanager.service
  • wpeframework-system.service
  • wpeframework-systemaudioplayer.service
  • wpeframework-systemmode.service
  • wpeframework-telemetry.service
  • wpeframework-texttospeech.service
  • wpeframework-usbdevice.service
  • wpeframework-usbmassstorage.service
  • wpeframework-usersettings.service
  • wpeframework-voicecontrol.service
  • wpeframework-wifi.service
  • wpeframework-xcast.service

Impact: Services cannot be enabled for automatic boot without manual symlinks.

Fix: Add to all files:

[Install]
WantedBy=multi-user.target

5. 💡 Recommendations for All Files

Add Documentation Comments

Add comments explaining:

  • Service purpose
  • Dependency rationale
  • Any non-standard timeout values
  • Conditional startup logic

Consider PrivateTmp=yes

For security isolation, add to [Service] section:

PrivateTmp=yes

Trailing Whitespace

Several files have trailing whitespace - clean this up for consistency.

Implementation Guidelines

For Each Service File:

  1. Add timeout directives:

    [Service]
    TimeoutStartSec=30
    TimeoutStopSec=10
  2. Add [Install] section:
    ...

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 5, 2026 20:07
…tion to all 52 systemd service files

Co-authored-by: anand-ky <37086488+anand-ky@users.noreply.github.com>
Co-authored-by: anand-ky <37086488+anand-ky@users.noreply.github.com>
Copilot AI changed the title [WIP] Review and improve systemd service files for compatibility Systemd service files: Add timeouts, [Install] sections, and fix dependencies Feb 5, 2026
Copilot AI requested a review from anand-ky February 5, 2026 20:13
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