Branden Robinson: > What, specifically, do you posit is wrong with the existing code?
Two issues: 1) The daemon itself creates the pid file but does not properly remove it when something goes wrong during startup, in example if it can't start the x-server. 2) The daemon itself creates the pid file, but the pid seems to be checked by the init.d script/start-stop-daemon, which is a somewhat unusual und non-intuitive behaviour. The problem can be reproduced easily: Do something to make the xdm startup at boot fail (maybe because of a wrong setting in XF86Config, a not yet recompiled nvidia-driver after a kernel update, ...) then try to run xdm from the command line (not via the init script, but directly). Imho the clean solution is to have the pid file properly removed when xdm shuts down for whatever reason, and have xdm check the pid in the file itself.

