Skip to content

fix: keep Type=forking behavior in dde-session-daemon-loader-wrapper - #1230

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
felixonmars:patch-1
Sep 2, 2026
Merged

fix: keep Type=forking behavior in dde-session-daemon-loader-wrapper#1230
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
felixonmars:patch-1

Conversation

@felixonmars

@felixonmars felixonmars commented Aug 31, 2026

Copy link
Copy Markdown
Member

The systemd service was changed to Type=forking in ee600cd, but 1f4a441 changed the wrapper back to directly exec the original daemon, which hangs the systemd service indefinitely on Arch since we don't have deepin-security-loader.

Let's revert to the fork-like behavior to fix this.

Summary by Sourcery

Bug Fixes:

  • Restore fork-like wrapper behavior so the Type=forking systemd service can start correctly without deepin-security-loader.

The systemd service was changed to `Type=forking` in linuxdeepin@ee600cd, but linuxdeepin@1f4a441 changed the wrapper back to directly exec the original daemon, which hangs the systemd service indefinitely on Arch since we don't have deepin-security-loader.

Let's revert to the fork-like behavior to fix this.
@sourcery-ai

sourcery-ai Bot commented Aug 31, 2026

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

Reviewer's Guide

The wrapper is adjusted to fork the original daemon instead of directly replacing the wrapper process, preventing the Type=forking systemd unit from hanging on systems without deepin-security-loader.

File-Level Changes

Change Details Files
Restore fork-like wrapper behavior so the systemd service can complete startup with Type=forking even when deepin-security-loader is unavailable.
  • Change the wrapper’s daemon-launch behavior from direct execution back to forking/background execution.
  • Preserve compatibility with the service’s existing Type=forking configuration.
misc/scripts/dde-session-daemon-loader-wrapper

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 reviewed your changes and they look great!


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.

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 92 分 (通过阈值: 70分)

Fail


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 代码变更目的明确,将 exec 替换为后台执行+exit 0 以适配 systemd Type=forking 行为。语法正确,逻辑清晰,无安全漏洞。存在2个功能性问题需关注:security-loader 路径仍使用 exec 可能与 Type=forking 不一致,以及 exit 0 未检查进程启动结果可能导致错误被静默吞掉。

🔍 详细分析

1. 语法逻辑 ✅

评价: 良好 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 1. 确认 security-loader 路径是否需要同步修改为 fork 行为 2. 如 deepin-security-loader 自身处理 fork,可添加注释说明


2. 代码质量 ✅

评价: 良好 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 1. 添加 $REAL_BINARY 存在性检查 2. 添加 exit 0 行为注释 3. 考虑对启动失败进行日志记录


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 无性能问题,将 exec 改为后台执行+exit 对性能无负面影响


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无安全漏洞,代码不涉及用户输入处理、网络通信等安全敏感操作


💡 改进建议代码示例

# 建议改进版本
logger -t dde-session-daemon "starting directly"
if [ -x "$REAL_BINARY" ]; then
    "$REAL_BINARY" "$@" &
    # exit 0 for systemd Type=forking - parent should exit after forking
    exit 0
else
    logger -t dde-session-daemon "error: $REAL_BINARY not found or not executable"
    exit 1
fi

本报告由 AI 代码审查工具自动生成

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: felixonmars, fly602

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

@BLumia

BLumia commented Sep 2, 2026

Copy link
Copy Markdown
Member

/merge

@deepin-bot
deepin-bot Bot merged commit 6045436 into linuxdeepin:master Sep 2, 2026
13 checks passed
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.

4 participants