Skip to content

fix: delegate autostart to systemd for reliable restart#271

Merged
Ivy233 merged 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/autostart-systemctl-restart
Jul 6, 2026
Merged

fix: delegate autostart to systemd for reliable restart#271
Ivy233 merged 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/autostart-systemctl-restart

Conversation

@Ivy233

@Ivy233 Ivy233 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Changed the XDG autostart desktop file to use systemctl --user start dde-clipboard.service instead of directly executing the binary. This ensures the clipboard process is managed by systemd, so Restart=always in the service file takes effect when the process is killed.

Log: Fixed clipboard not restarting after being killed when started via XDG autostart

Influence:

  1. Test killing dde-clipboard process and verify it restarts automatically
  2. Verify clipboard functionality continues working after restart
  3. Test system startup to ensure clipboard service starts properly
  4. Verify clipboard window appears correctly without transparency issues

fix: 通过 systemd 托管 autostart 启动,修复 kill 后无法自动重启

将 XDG autostart 桌面文件的 Exec 改为使用 systemctl --user start dde-clipboard.service 而非直接执行二进制文件。这样剪贴板进程由
systemd 管理,确保服务文件中的 Restart=always 在进程被杀死后生效。

Log: 修复剪切板通过 XDG autostart 启动后被杀死无法自动重启的问题

Influence:

  1. 测试手动杀死 dde-clipboard 进程并验证其自动重启
  2. 验证剪贴板功能在服务重启后继续正常工作
  3. 测试系统启动时剪贴板服务是否正确启动
  4. 验证剪切板窗口启动时无透明问题

PMS: BUG-365901

Summary by Sourcery

Bug Fixes:

  • Ensure dde-clipboard automatically restarts when started via XDG autostart and the process is killed.

Changed the XDG autostart desktop file to use `systemctl --user start
dde-clipboard.service` instead of directly executing the binary. This
ensures the clipboard process is managed by systemd, so Restart=always
in the service file takes effect when the process is killed.

Log: Fixed clipboard not restarting after being killed when started via
XDG autostart

Influence:
1. Test killing dde-clipboard process and verify it restarts automatically
2. Verify clipboard functionality continues working after restart
3. Test system startup to ensure clipboard service starts properly
4. Verify clipboard window appears correctly without transparency issues

fix: 通过 systemd 托管 autostart 启动,修复 kill 后无法自动重启

将 XDG autostart 桌面文件的 Exec 改为使用 `systemctl --user start
dde-clipboard.service` 而非直接执行二进制文件。这样剪贴板进程由
systemd 管理,确保服务文件中的 Restart=always 在进程被杀死后生效。

Log: 修复剪切板通过 XDG autostart 启动后被杀死无法自动重启的问题

Influence:
1. 测试手动杀死 dde-clipboard 进程并验证其自动重启
2. 验证剪贴板功能在服务重启后继续正常工作
3. 测试系统启动时剪贴板服务是否正确启动
4. 验证剪切板窗口启动时无透明问题

PMS: BUG-365901
@sourcery-ai

sourcery-ai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Routes dde-clipboard XDG autostart through the user systemd service instead of launching the binary directly, so the systemd unit’s Restart=always reliably handles process restarts.

File-Level Changes

Change Details Files
Delegate dde-clipboard XDG autostart to the user systemd service for reliable restarts instead of executing the binary directly.
  • Update the Exec command in the dde-clipboard XDG autostart desktop entry to call systemctl --user start dde-clipboard.service.
  • Ensure the clipboard daemon is started and supervised by systemd so Restart=always in the service unit is honored when the process exits or is killed.
  • Align startup behavior between system boot and manual/autostart launches to avoid cases where the clipboard does not restart after being killed.
misc/dde-clipboard.desktop.in

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

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:

  • Consider what happens on systems where systemd --user is unavailable or fails (e.g., non-systemd sessions) and whether the desktop entry should degrade gracefully or detect/guard against this case.
  • If the desktop entry previously passed any arguments or environment to dde-clipboard, double-check whether those need to be reflected in the systemd service, otherwise behavior may subtly change when started via systemctl --user.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider what happens on systems where `systemd --user` is unavailable or fails (e.g., non-systemd sessions) and whether the desktop entry should degrade gracefully or detect/guard against this case.
- If the desktop entry previously passed any arguments or environment to `dde-clipboard`, double-check whether those need to be reflected in the systemd service, otherwise behavior may subtly change when started via `systemctl --user`.

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.

@Ivy233
Ivy233 requested review from xionglinlin and yixinshark June 25, 2026 02:12
@deepin-bot

deepin-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.1.31
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #273

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ivy233, 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

@Ivy233
Ivy233 merged commit 1dda538 into linuxdeepin:master Jul 6, 2026
19 checks passed
@Ivy233
Ivy233 deleted the fix/autostart-systemctl-restart branch July 6, 2026 01:30
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.

3 participants