fix: 解决新装镜像创建用户后出现开机音效服务启动失败的问题#155
Conversation
创建用户时,lightdm已经启动了,这时候还没有用户,开机音效服务获取不到用户信息,导致运行报错。改成脚本执行,忽略报错。 Log: 开机音效服务中的二进制改成脚本执行,忽略运行报错 PMS: BUG-332437 Influence: login-sound.service
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR replaces the direct D-Bus binary call in the login-sound service with a wrapper script that ignores errors when no user exists, and updates that script to use the correct D-Bus interface paths. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 6.0.26 |
deepin pr auto review我来对这段代码进行审查,主要关注语法逻辑、代码质量、性能和安全性。 语法逻辑分析
代码质量评估
性能考虑
安全性评估
改进建议
改进后的脚本示例: #!/bin/sh
# 检必要的环境变量
if [ -z "$XDG_RUNTIME_DIR" ]; then
export XDG_RUNTIME_DIR="/run/user/$(id -u deepin-daemon)"
fi
# 记录日志
logger "Starting deepin boot sound"
# 执行 D-Bus 调用
/usr/bin/dbus-send --system --print-reply \
--dest=org.deepin.dde.SoundThemePlayer1 \
/org/deepin/dde/SoundThemePlayer1 \
org.deepin.dde.SoundThemePlayer1.PlaySoundDesktopLogin
# 检查执行结果
if [ $? -ne 0 ]; then
logger "Failed to play boot sound"
exit 1
fi
exit 0这些建议可以提高代码的健壮性、安全性和可维护性。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, mhduiy 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 |
|
TAG Bot New tag: 6.0.27 |
创建用户时,lightdm已经启动了,这时候还没有用户,开机音效服务获取不到用户信息,导致运行报错。改成脚本执行,忽略报错。
Log: 开机音效服务中的二进制改成脚本执行,忽略运行报错
PMS: BUG-332437
Influence: login-sound.service
Summary by Sourcery
Prevent login sound service from failing on new installations by invoking it through a script that ignores errors and updating the D-Bus interface names
Bug Fixes: