-
Notifications
You must be signed in to change notification settings - Fork 30
fix: avoid error messages when service condition checks fail #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
[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 |
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: