Skip to content

Commit 6a97618

Browse files
committed
fix: avoid error messages when service condition checks fail
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
1 parent 1059b63 commit 6a97618

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

systemd/dde-session-pre.target.wants/dde-quick-login@x11.service

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ After=dde-session@x11.service
88
PartOf=dde-session-pre.target
99
Before=dde-session-pre.target
1010

11+
# only in quick login mode and x11
12+
ConditionEnvironment=DDE_QUICKLOGIN=true
13+
ConditionEnvironment=XDG_SESSION_TYPE=%I
14+
1115
# SuccessExitStatus=0,launch dde-lock.service
1216
OnSuccess=dde-lock.service dde-version-checker@quick-login.service dde-autostart@quick-login.service
1317

1418
[Service]
1519
Slice=session.slice
1620
Type=notify
17-
# only in quick login mode and x11
18-
ExecCondition=/bin/sh -c '[ "$DDE_QUICKLOGIN" = "true" ] || exit 255'
19-
ExecCondition=/bin/sh -c '[ "$XDG_SESSION_TYPE" = "%I" ] || exit 255'
2021
ExecStart=/usr/bin/dde-quick-login
2122
SuccessExitStatus=0
2223
Restart=on-failure

tools/dde-version-checker/dde-version-checker@quick-login.service

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Description=dde-version-checker service (after quick login)
33
CollectMode=inactive-or-failed
44

5+
# only in quick login mode
6+
ConditionEnvironment=DDE_QUICKLOGIN=true
7+
58
[Service]
69
Type=simple
710
ExecStart=/usr/bin/dde-version-checker

0 commit comments

Comments
 (0)