fix: Avoid autostart service being executed twice#182
fix: Avoid autostart service being executed twice#182yixinshark merged 1 commit intolinuxdeepin:masterfrom
Conversation
When ExecCondition returns an exit code that is non-zero but not 255, the service is marked as "skipped" rather than "failed". The skipped state may be treated as success by some versions of systemd, thereby triggering OnSuccess! Log: as title Pms: BUG-343321
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the dde-quick-login@x11 systemd service definition so that its ExecCondition no longer leads to the unit being marked as "skipped" (and potentially autostarting twice) when it returns a non-zero, non-255 exit code, ensuring OnSuccess is not incorrectly triggered. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来对这个systemd服务文件的修改进行审查:
改进建议:
# Use 255 as unified error code for all condition checks
ExecCondition=/bin/sh -c '[ "$DDE_QUICKLOGIN" = "true" ] || exit 255'
ExecCondition=/bin/sh -c '[ "$XDG_SESSION_TYPE" = "%I" ] || exit 255'
ExecCondition=/bin/sh -c 'echo "Checking quick login mode: $DDE_QUICKLOGIN" >&2; [ "$DDE_QUICKLOGIN" = "true" ] || exit 255'总的来说,这个修改在技术上是可行的,但从可维护性和调试的角度来看,保持原有的不同退出码会是更好的选择。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, 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 |
|
用户级的 shell 环境变量展开理论上没有安全风险 |
When ExecCondition returns an exit code that is non-zero but not 255, the service is marked as "skipped" rather than "failed". The skipped state may be treated as success by some versions of systemd, thereby triggering OnSuccess!
Log: as title
Pms: BUG-343321
Summary by Sourcery
Bug Fixes: