xdm not executing Xstartup

(Comments)

I had a perplexing issue with XDM.
I followed these instructions to add a shutdown button to the login screen for XDM. This is for a laptop, so I'm not really concerned about unauthorized people clicking it and shutting down long-term processes.
The tricky part is that the process creating this button needs to be killed just after a user successfully authenticates. This can be done in the Xstartup script for XDM, as you can see from the manpage:

The xlogin widget, which xdm presents, offers the familiar login and password prompts.

       After the user logs in, xdm runs the Xstartup script as root.

       Then xdm runs the Xsession script as the user.  This system session file may do some additional startup and typically runs the
       .xsession script in the user's home directory.  When the Xsession script exits, the session is The xlogin widget, which xdm presents, offers the familiar login and password prompts.

       After the user logs in, xdm runs the Xstartup script as root.

       Then xdm runs the Xsession script as the user.  This system session file may do some additional startup and typically runs the
       .xsession script in the user's home directory.  When the Xsession script exits, the session is over.over.

The location of your Xstartup script is defined in xdm-config. Here's my default in Gentoo:

DisplayManager*startup:         /usr/lib64/X11/xdm/Xstartup
DisplayManager*session:         /usr/lib64/X11/xdm/Xsession
DisplayManager*reset:           /usr/lib64/X11/xdm/Xreset
DisplayManager*authComplain:    true
! The following three resources set up display :0 as the console.
DisplayManager._0.setup:        /usr/lib64/X11/xdm/Xsetup_0
DisplayManager._0.startup:      /usr/lib64/X11/xdm/GiveConsole
DisplayManager._0.reset:        /usr/lib64/X11/xdm/TakeConsole

So, the script that executes when I log in is /usr/lib64/X11/xdm/Xstartup, right? Nope. It's /usr/lib64/X11/xdm/GiveConsole. The second setting overrides the first in the particular case. I had to add my bits of script there and all was well.

Currently unrated

Comments