From: haberj@Informatik.TU-Muenchen.DE (Haber Joerg)
Subject: diskless SUN & xdm
Keywords: xdm, diskless
Originator: haberj@sunbulirsch4.mathematik.tu-muenchen.de
Organization: Technische Universitaet Muenchen, Germany
Date: Thu, 10 Sep 1992 14:06:34 GMT


I've got a strange problem here with a pool of diskless SUNs 
running X11R5:
The H/W-configuration is 9 SUN ELC, 3 of them with a 1 GB harddisk
acting as bootservers for the other 6 ELCs (i.e. 2 diskless clients
on each server). In order to assure a consistent filesystem, the 3
servers perform a 'shutdown -r' each night from Sunday to Monday at
2:00 am. Furthermore 3 of the clients (one on each server) perform 
a 'shutdown -r' at 2:15 am (Monday), the other 3 clients do so 
another 15 minutes later (at 2:30). This is to remove any hanging
processes out of the memory (e.g. diskwait processes). This strategy
of rebooting the workstations once a week has shown to be useful with
all our SUNs. But here is my problem:
All the SUNs are running X11R5 initially, so the last lines in the
/etc/rc look like:

if [ -f /usr/bin/X11/xdm ]; then
        host=`/usr/bin/hostname`
        if [ -f /usr/lib/X11/xdm/xdm-pid.${host} ]; then
                rm -f /usr/lib/X11/xdm/xdm-pid.${host}
        fi
        /usr/bin/X11/xdm -config /usr/lib/X11/xdm/xdm-config.${host}
        echo 'starting xdm...'
fi

As you can see each client has it's own configuration file. That is
because the xdm creates a lockfile (usually /usr/lib/X11/xdm/xdm-pid)
upon starting. The different config-files change the name of the
lockfile to 'xdm-pid.<hostname>' where hostname is the hostname of
the client. This should really enable xdm to come up in a clean way.
Moreover I'm removing a lockfile before xdm starts up if it exists
(for some reason the clients sometimes can't remove the lockfile 
during their shutdown ?).
And what do you guess ? Some of the clients get their xdm running
while others do not ! It is unpredictable to say which client will
get it's xdm running and which won't, i.e. not always the same clients
are successful in starting their xdm. Sometimes a second reboot 
(manually) will solve the problem, but not always. I've had cases, in 
which a client didn't get it's xdm running in 5 reboots ! When I log
into a machine that didn't manage to run the xdm, I can get a line
from 'ps -ax' similar like this one:
 139 ?  S     0:00 /usr/bin/X11/xdm -config /usr/lib/X11/xdm/xdm-config...
The xdm is running, but it didn't write it's pid in the lockfile.
The lockfile exists and has zero-length (whereas usually is has a
fixed length of 6 bytes containing the pid of the xdm). Doing a
'kill -9' on the xdm will leave a process with the same pid as the
xdm in memory, but with <exiting> status. It is not possible to start
a new xdm in this case.
As this problem seems to be independent of the machine except that it
appears on diskless clients only, I consider it to be a network-problem.

If you do have any suggestions or solutions please send me an E-Mail
to the address given below. If I can fix the problem with your help
I will summarize the solution and post it to this newsgroup.

Bye, Joerg

--
  Joerg Haber                haberj@mathematik.tu-muenchen.de
  Mathematisches Institut
  TU Muenchen