Skip to content

fix: add no-stop-on-upgrade to systemd install - #5

Merged
zccrs merged 1 commit into
linuxdeepin:dde/0.9.3from
wineee:dde/0.9.3
Jun 4, 2026
Merged

zccrs merged 1 commit into
linuxdeepin:dde/0.9.3from
wineee:dde/0.9.3

Conversation

@wineee

@wineee wineee commented Jun 4, 2026

Copy link
Copy Markdown
Member

Added the --no-stop-on-upgrade flag to the dh_installsystemd command in debian/rules. This change ensures that the dde-seatd systemd service is not stopped during package upgrades, which can help prevent service interruptions and maintain system stability during upgrades. The existing --no-start and --no-enable flags remain unchanged.

Added the --no-stop-on-upgrade flag to the dh_installsystemd command
in debian/rules. This change ensures that the dde-seatd systemd service
is not stopped during package upgrades, which can help prevent service
interruptions and maintain system stability during upgrades. The
existing --no-start and --no-enable flags remain unchanged.
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

你好!我是智能编程助手 CodeGeeX。我已仔细审查了你提供的 git diff 内容。

本次修改针对的是 Debian 打包规则文件 debian/rules,具体是在 override_dh_installsystemd 目标中,为 dh_installsystemd 命令新增了 --no-stop-on-upgrade 参数。

以下是我对本次代码变更的详细审查意见:

1. 语法逻辑

  • 语法正确性:修改语法完全符合 Debhelper 的规则语法,参数格式正确。
  • 逻辑一致性:逻辑非常合理。注意到在上方的 override_dh_installinit: 中已经使用了 --no-stop-on-upgrade 参数。本次修改使得 Systemd 服务和 SysVinit 服务在系统升级时的行为保持一致,避免了因初始化系统不同而导致的升级行为差异。

2. 代码质量

  • 意图清晰:--no-stop-on-upgrade 是一个语义非常明确的 Debhelper 参数,开发者可以直观地看出其意图是在包升级时不停止服务。
  • 风格统一:如前所述,这次修改补齐了与 dh_installinit 的行为对称性,提升了打包脚本的代码质量和可维护性。

3. 代码性能

  • 对构建性能的影响:增加一个 Debhelper 参数对 Debian 包的构建性能没有任何负面影响。
  • 对运行时性能的影响:在系统升级时,不停止服务意味着服务进程不会中断重启,这实际上减少了服务停机时间,从用户体验和系统可用性的角度来看,是一种性能/体验的提升(特别是对于显示管理器相关的底层服务如 dde-seatd)。

4. 代码安全与潜在风险(重点关注)

虽然语法和逻辑没有问题,但在系统运维和安全层面,引入 --no-stop-on-upgrade 需要特别注意以下几点:

  • 服务状态不一致风险:在包升级时,如果服务的二进制文件或依赖库被更新,而服务进程没有被重启,旧进程将继续在内存中运行旧版本的代码。这可能导致旧进程在读取磁盘上的新配置文件时发生解析错误或行为异常。
  • 内存安全漏洞修复失效:如果本次升级是为了修复 dde-seatd 中的某个安全漏洞(如内存越界、提权漏洞),仅仅升级包而不重启服务是无法修补正在运行的进程的,系统依然处于受威胁状态。
  • --no-start 与 --no-stop-on-upgrade 的组合:当前配置同时使用了 --no-start 和 --no-stop-on-upgrade。这意味着包安装/升级后既不会自动启动,升级时也不会自动停止。这通常用于需要复杂手动配置后才允许启动的服务,或者由其他高层级服务来拉起的情况。请确认这是 dde-seatd 期望的部署策略。

💡 改进建议

  1. 确认 dde-seatd 的升级兼容性:请确保 dde-seatd 在升级后,旧进程能够安全地读取新版本的配置文件而不崩溃。如果配置文件不兼容,使用 --no-stop-on-upgrade 可能会导致桌面环境异常。
  2. 提供重启机制:如果因为特殊原因必须使用 --no-stop-on-upgrade(例如避免升级时用户会话掉线),建议在包的 postinst 维护脚本中,通过检查并提示用户重启服务,或者在系统下次重启时生效;或者考虑使用 Systemd 的 socket activation 或 live patch 机制。
  3. 补充 Changelog 说明:这是一个影响系统升级行为的关键变更,务必在 debian/changelog 中明确记录引入 --no-stop-on-upgrade 的原因,以便后续维护者知晓其背景。

总结:代码修改本身规范且合理,主要风险在于升级后服务进程与文件版本不一致带来的安全隐患和稳定性问题。只要确认 dde-seatd 能够妥善处理这种不一致状态,该修改是可以接受的。

@zccrs
zccrs merged commit 486edb5 into linuxdeepin:dde/0.9.3 Jun 4, 2026
10 checks passed
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wineee, zccrs

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

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