nerdexam
LPI

102-500 · Question #205

On a system running the KDE Display Manager, when is the /etc/kde4/kdm/Xreset script automatically executed?

The correct answer is B. When a user's X session exits. See the full explanation below for the reasoning.

Question

On a system running the KDE Display Manager, when is the /etc/kde4/kdm/Xreset script automatically executed?

Options

  • AWhen KDM starts
  • BWhen a user's X session exits
  • CWhen KDM crashes
  • DWhen X is restarted
  • EWhen X crashes

How the community answered

(27 responses)
  • A
    7% (2)
  • B
    70% (19)
  • C
    15% (4)
  • D
    4% (1)
  • E
    4% (1)

Community Discussion

7
Bao N.Bao N.Apr 18, 2026

B is the one you want to commit to memory. The Xreset script in KDM is the logout-side counterpart to Xsession, meaning it fires automatically when a user's X session ends cleanly, right after the user logs out. Think of it as a cleanup hook, the display manager hands control back to the login screen and triggers Xreset to do any teardown work like removing temp files or resetting environment state. The other options are traps, KDM startup triggers Xsetup, not Xreset, and crashes are not scripted events that invoke these hooks in a predictable way.

12
Samuel O.Samuel O.May 10, 2026

Xreset runs cleanup after logout, not on crashes, so B.

4
Wesley A.Wesley A.Apr 3, 2026

I got this one wrong the first time because I confused Xreset with Xstartup and thought it was tied to KDM initializing, but when I came back and really thought about the naming, reset versus start told the whole story. Xreset runs when a user's X session exits, cleaning up after the session the same way a janitor comes in after the guests leave, not when the doors open, and that mental image is what locked in B for me on the retake.

1
Brenda K.Brenda K.May 1, 2026

X crashes, Xreset fires to clean up the session, lock in E.

-1
Wesley A.Wesley A.May 2, 2026

Brenda, I get the logic but Xreset runs when the session ends normally or after Xstartup completes, not specifically as a crash handler, so that reasoning does not hold up here. The answer is B, and I burned points on this exact trap the first time through.

0
Carlos M.Carlos M.May 20, 2026

Going with C on this one. The Xreset script is a cleanup script, and the scenario where KDM itself crashes is exactly when you need that kind of reset hook to fire so the system can recover cleanly rather than leaving stale sessions or locked resources behind. Think about it logically, if it ran on every normal session exit (B) you would see it firing constantly during normal use, which does not match the purpose of a recovery-oriented script. The name "Xreset" itself implies a reset condition, not a routine logout handler, and a crash is the most obvious reset condition in the whole flow. I have seen similar patterns in other display managers where crash hooks exist specifically to clean up after abnormal termination, and KDM follows that same design philosophy.

-1
Wesley A.Wesley A.May 20, 2026

Carlos, good reasoning on the intent but B is actually correct here. Xreset fires after every session ends, meaning every normal logout too, because its job is to reset the display environment back to a clean state for the next user, not just to handle crash recovery.

0
Full 102-500 Practice