feat: add deepin-daemon service group support#78
Merged
fly602 merged 1 commit intolinuxdeepin:masterfrom Dec 15, 2025
Merged
Conversation
yixinshark
reviewed
Dec 12, 2025
src/deepin-service-manager/main.cpp
Outdated
| if (!useCoreApp) { | ||
| struct passwd *pw = getpwuid(euid); | ||
| if (pw != nullptr) { | ||
| QString username = QString::fromUtf8(pw->pw_name); |
src/deepin-service-manager/main.cpp
Outdated
| } else { | ||
| bool useCoreApp = (euid == 0); | ||
|
|
||
| // 检查是否是 deepin-admin 或 deepin-daemon 用户 |
Added support for deepin-daemon service group with specific user context 1. Created systemd drop-in configuration for deepin-daemon group to run as deepin-daemon user 2. Modified application initialization logic to detect deepin-daemon user and use QCoreApplication 3. Updated service group list to include deepin-daemon group 4. Added comments in service template explaining the deepin-daemon specific configuration Log: Added deepin-daemon service group support with dedicated user context Influence: 1. Test deepin-daemon service group startup and operation 2. Verify that services in deepin-daemon group run under deepin-daemon user 3. Check systemd service status and user context configuration 4. Test application behavior when running as deepin-daemon user vs regular user 5. Verify service group serialization order including new deepin-daemon group feat: 新增 deepin-daemon 服务组支持 添加对 deepin-daemon 服务组的支持,包含特定用户上下文配置 1. 创建 systemd drop-in 配置,使 deepin-daemon 组以 deepin-daemon 用户身 份运行 2. 修改应用初始化逻辑,检测 deepin-daemon 用户并使用 QCoreApplication 3. 更新服务组列表以包含 deepin-daemon 组 4. 在服务模板中添加注释说明 deepin-daemon 特定配置 Log: 新增 deepin-daemon 服务组支持,使用专用用户上下文 Influence: 1. 测试 deepin-daemon 服务组的启动和运行 2. 验证 deepin-daemon 组中的服务是否以 deepin-daemon 用户身份运行 3. 检查 systemd 服务状态和用户上下文配置 4. 测试应用在以 deepin-daemon 用户运行时与普通用户运行时的行为差异 5. 验证服务组序列化顺序,包括新的 deepin-daemon 组
deepin pr auto review我来对这个 git diff 进行详细的代码审查:
a) 文件名拼写错误: static const QStringList GroupSiral{ "core", "dde", "app", "deepin-daemon" };"GroupSiral" 应该改为 "GroupSerial"。 b) 用户检查逻辑可以优化: bool useCoreApp = (euid == 0);
if (!useCoreApp) {
struct passwd *pw = getpwuid(euid);
useCoreApp = (pw && QString::fromUtf8(pw->pw_name) == "deepin-daemon");
}建议改为更清晰的写法: bool useCoreApp = false;
if (euid == 0) {
useCoreApp = true;
} else {
struct passwd *pw = getpwuid(euid);
useCoreApp = (pw && QString::fromUtf8(pw->pw_name) == "deepin-daemon");
}c) 安全性考虑:
这些修改将提高代码的可靠性、可维护性和安全性。建议在实施这些改进时,先在测试环境中验证所有更改。 |
yixinshark
approved these changes
Dec 15, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for deepin-daemon service group with specific user context
Log: Added deepin-daemon service group support with dedicated user context
Influence:
feat: 新增 deepin-daemon 服务组支持
添加对 deepin-daemon 服务组的支持,包含特定用户上下文配置
Log: 新增 deepin-daemon 服务组支持,使用专用用户上下文
Influence: