Skip to content

perf: optimize systemd services startup and cleanup dependencies#201

Open
yixinshark wants to merge 1 commit intolinuxdeepin:masterfrom
yixinshark:perf-service
Open

perf: optimize systemd services startup and cleanup dependencies#201
yixinshark wants to merge 1 commit intolinuxdeepin:masterfrom
yixinshark:perf-service

Conversation

@yixinshark
Copy link
Copy Markdown
Contributor

@yixinshark yixinshark commented Apr 13, 2026

  • Change dde-shell and dde-shell-plugin services to Type=dbus and specify BusName to ensure correct startup order.

  • Remove obsolete application manager dependencies and comments in dde-shell service.

  • Use ConditionEnvironment in dde-session@x11 service and consolidate ExecStartPre for better performance.

  • 将 dde-shell 和 dde-shell-plugin 服务类型改为 Type=dbus 并指定 BusName,确保正确的启动顺序。

  • 移除 dde-shell 服务中过时的应用管理器依赖及注释。

  • 在 dde-session@x11 服务中改用 ConditionEnvironment 并合并 ExecStartPre 以提升性能。

Log: optimize systemd services startup and cleanup dependencies
Change-Id: I75754a0dd09172d891237955456d881a86cee34b

Summary by Sourcery

Optimize systemd service startup ordering and cleanup obsolete dependencies for dde-shell, dde-shell-plugin, and dde-session@x11.

Enhancements:

  • Switch dde-shell and dde-shell-plugin services to D-Bus-activated units with explicit bus names to improve startup ordering.
  • Refine dde-session@x11 service conditions and pre-start commands to streamline session startup performance.

Chores:

  • Remove outdated dde-shell application manager dependencies and related comments from systemd unit configuration.

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yixinshark

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 13, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adjusts several systemd user services for DDE to improve startup ordering, cleanup obsolete dependencies, and streamline pre-start logic for better session startup performance.

File-Level Changes

Change Details Files
Switch dde-shell and dde-shell-plugin services to DBus-activated units with explicit BusName for more reliable startup ordering.
  • Change the systemd service Type from the previous value (likely simple or idle) to Type=dbus for dde-shell-related units.
  • Add or update the BusName setting so that activation is tied to the appropriate org.deepin.* DBus name.
  • Ensure the units under dde-session-core.target.wants reference the updated service definitions without altering their target dependencies.
systemd/dde-session-core.target.wants/dde-shell-plugin@org.deepin.ds.desktop.service
systemd/dde-session-core.target.wants/dde-shell@DDE.service
Clean up obsolete application manager dependencies and comments in the dde-shell service unit.
  • Remove outdated Wants/Requires or After directives that reference the legacy application manager unit(s).
  • Delete corresponding comments that refer to the removed dependency or old startup behavior, keeping only currently relevant documentation inside the unit file.
systemd/dde-session-core.target.wants/dde-shell@DDE.service
Optimize dde-session@x11 service startup using ConditionEnvironment and consolidated ExecStartPre steps.
  • Replace previous environment-based checks (e.g., EnvironmentFile or conditional ExecStartPre scripts) with a ConditionEnvironment directive to gate startup.
  • Merge multiple ExecStartPre commands into a single pre-start sequence or script to reduce process spawning and simplify ordering.
  • Retain the service’s role in dde-session-pre.target.wants while minimizing overhead during session initialization.
systemd/dde-session-pre.target.wants/dde-session@x11.service

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • When switching dde-shell and dde-shell-plugin to Type=dbus, double-check that the configured BusName exactly matches the name actually acquired by the processes, otherwise systemd may mis-handle startup and failure detection.
  • Since you removed the old application manager dependencies from dde-shell, consider whether any ordering or Requires/Wants relationships need to be retained in a different form to avoid regressions in environments that still expect that startup sequencing.
  • For the new ConditionEnvironment usage in dde-session@x11.service, verify that the condition correctly discriminates between X11 and other session types (e.g. Wayland) and that it behaves as expected in edge cases like nested or remote sessions.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- When switching dde-shell and dde-shell-plugin to Type=dbus, double-check that the configured BusName exactly matches the name actually acquired by the processes, otherwise systemd may mis-handle startup and failure detection.
- Since you removed the old application manager dependencies from dde-shell, consider whether any ordering or Requires/Wants relationships need to be retained in a different form to avoid regressions in environments that still expect that startup sequencing.
- For the new ConditionEnvironment usage in dde-session@x11.service, verify that the condition correctly discriminates between X11 and other session types (e.g. Wayland) and that it behaves as expected in edge cases like nested or remote sessions.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- Change dde-shell and dde-shell-plugin services to Type=dbus and specify BusName to ensure correct startup order.
- Remove obsolete application manager dependencies and comments in dde-shell service.
- Use ConditionEnvironment in dde-session@x11 service and consolidate ExecStartPre for better performance.

- 将 dde-shell 和 dde-shell-plugin 服务类型改为 Type=dbus 并指定 BusName,确保正确的启动顺序。
- 移除 dde-shell 服务中过时的应用管理器依赖及注释。
- 在 dde-session@x11 服务中改用 ConditionEnvironment 并合并 ExecStartPre 以提升性能。

Log: optimize systemd services startup and cleanup dependencies
Pms: TASK-384099
Change-Id: I75754a0dd09172d891237955456d881a86cee34b
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