fix: avoid error messages when service condition checks fail#189
Merged
yixinshark merged 1 commit intolinuxdeepin:masterfrom Feb 4, 2026
Merged
fix: avoid error messages when service condition checks fail#189yixinshark merged 1 commit intolinuxdeepin:masterfrom
yixinshark merged 1 commit intolinuxdeepin:masterfrom
Conversation
Use ConditionEnvironment instead of ExecCondition for environment variable checks. This prevents the service from being marked as failed when the condition is not met. Changes: - Add ConditionEnvironment=DDE_QUICKLOGIN=true to [Unit] section - Add ConditionEnvironment=XDG_SESSION_TYPE=%I to [Unit] section - Remove ExecCondition shell script checks - Apply the same fix to dde-version-checker@quick-login.service This resolves the issue where systemd would report 'Failed to start' error messages when the quick login conditions were not satisfied, which could also trigger unwanted restart loops. Log: avoid error messages when service condition checks fail Pms: BUG-349919
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces ExecCondition-based shell checks with systemd ConditionEnvironment expressions in dde quick-login related services so that unmet conditions skip starting without marking the service as failed or causing restart loops. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Using
ConditionEnvironment=means systemd will check the manager environment, not the service’s runtime environment, so please double-check thatDDE_QUICKLOGINandXDG_SESSION_TYPEare actually exported into PID 1’s environment (or provided via anEnvironmentFile=/systemd-environment-d-generator) rather than only being set in user shells. - Since you’ve duplicated similar
ConditionEnvironmentlogic across multiple units, consider factoring the common conditions into a shared drop-in or template pattern to keep the configuration consistent and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Using `ConditionEnvironment=` means systemd will check the manager environment, not the service’s runtime environment, so please double-check that `DDE_QUICKLOGIN` and `XDG_SESSION_TYPE` are actually exported into PID 1’s environment (or provided via an `EnvironmentFile=`/`systemd-environment-d-generator`) rather than only being set in user shells.
- Since you’ve duplicated similar `ConditionEnvironment` logic across multiple units, consider factoring the common conditions into a shared drop-in or template pattern to keep the configuration consistent and easier to maintain.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
fly602
approved these changes
Feb 4, 2026
|
[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.
Use ConditionEnvironment instead of ExecCondition for environment variable checks. This prevents the service from being marked as failed when the condition is not met.
Changes:
This resolves the issue where systemd would report 'Failed to start' error messages when the quick login conditions were not satisfied, which could also trigger unwanted restart loops.
Log: avoid error messages when service condition checks fail
Pms: BUG-349919
Summary by Sourcery
Bug Fixes: