Customizing your login on Purdue CS computers (WIP, but updated)
This article is currently a Work-In-Progress. Other than the one place where I say “I’m not sure”, the GDM section is complete. The network shares section is a mess, but has some good information.
Most CS students at Purdue spend a lot of time on the lab boxes, but don’t know a lot about them. This document tries to fix that.
The lab boxes all run Gentoo.
GDM, the Gnome Display Manager
The boxes run
gdm (Gnome Display Manager) 2.20.11 for the login screen. This is an old version, and has a couple behaviors that are slightly different than new versions, but here are the important bits:
~/.dmrc(more recent versions use
~/.desktop, but Purdue boxes aren’t running more recent versions)
Purdue’s GDM configuration
This is important, because there are multiple locations that look like these files; I take it that they were used at sometime in the past. Don’t get tricked into thinking that it looks at
/etc/X11/gdm/Xsession (which exists, and is where it would look by default).
If you look at the GDM login screen, it has a “Sessions” button that opens a prompt where you can select any of several sessions:
- Last session
- 1. MATE (
- 2. CS Default Session (
- 3. Custom Session (
- 4. FVWM2 (
- 5. gnome.desktop (
- 6. KDE (
- Failsafe MATE (
- Failsafe Terminal (
The main 6 are configured by the
.desktop files in
SessionDesktopDir=/usr/local/share/xsessions; the last 2 are auto-generated. The reason
ShowGnomeFailsafeSession correctly generates a Mate session instead of a Gnome session is because of the patch
I’m not sure why Gnome shows up as
gnome.desktop instead of
GNOME as specified by
gnome.desktop:Name. I imagine it might be something related to the aforementioned patch, but I can’t find anything in the patch that looks like it would screw that up; at least not without a better understanding of GDM’s code.
Which of the main 6 is used by default (“Last Session”) is configured with
~/.dmrc:Session, which contains the basename of the associated
.desktop file (that is, without any directory part or file extension).
Every one of the
.desktop files sets
Type=XSession, which means that instead of running the argument in
Exec= directly, it passes it as arguments to the
Xsession program (in the location configured by
So, now we get to read
Before it does anything else, it:
- Try to set up logging to one of
/tmp/xses-$USER(it tries them in that order).
- Fiddles with the maximum number of processes.
After that, it handles these 3 “special” arguments that were given to it by various
failsafe: Runs a single xterm window. NB: This is NOT run by either of the failsafe options. It is likey a vestiage from a prior configuration.
startkde: Displays a message saying KDE is no longer available.
gnome-session: Displays a message saying GNOME has been replaced by MATE.
Assuming that none of those were triggered, it then does:
xrdb -merge ~/.Xresources
Finally, it has a switch statement over the arguments given to it by the various
mate-session: It has this whole script to start DBus, run the
mate-sessioncommand, then cleanup when it’s done.
eval exec "$@", which results in it executing the
Your data is on various hosts. I believe most undergrads have their data on
data.cs.purdue.edu (or just
data). Others have theirs on
tux (that I know of).
Most of the boxes with tons of storage have many network cards; each with a different IP; a single host’s IPs are mostly the same, but with varying 3rd octets. For example,
data is 128.10.X.13. If you need a particular value of X, but don’t want to remember the other octets; they are individually addressed with
BASENAME-NUMBER.cs.purdue.edu. For example,
data-25.cs.purdu.edu is 188.8.131.52.
They use AutoFS quite extensively. The maps are generated dynamically by
/etc/autofs/*.map, which are all symlinks to
/usr/libexec/amd2autofs. As far as I can tell,
amd2autofs is custom to Purdue. Its source lives in
/p/portage/*/overlay/net-fs/autofs/files/amd2autofs.c. The name appears to be a misnomer; seems to claim to dynamically translate from the configuration of Auto Mounter Daemon (AMD) to AutoFS, but it actually talks to NIS. It does so using the
yp interface, which is in Glibc for compatibility, but is undocumented. For documentation for that interface, look at the one of the BSDs, or Mac OS X. From the comments in the file, it appears that it once did look at the AMD configuration, but has since been changed.
There are 3 mountpoints using AutoFS:
/homes creates symlinks on-demand from
/u mounts NFS shares to
/u/SERVERNAME on-demand, and creates symlinks from
/p mounts on-demand various NFS shares that are organized by topic; the Xinu/MIPS tools are in
/p/xinu, the Portage tree is in
I’m not sure how
scratch works; it seems to be heterogenous between different servers and families of lab boxes. Sometimes it’s in
/u, sometimes it isn’t.
This 3rd-party documentation was very helpful to me: http://www.linux-consulting.com/Amd_AutoFS/ It’s where Gentoo points for the AutoFS homepage, as it doesn’t have a real homepage. Arch just points to FreshMeat. Debian points to kernel.org.
Lore is a SunOS 5.10 box running on Sun-Fire V445 (sun4u) hardware. SunOS is NOT GNU/Linux, and sun4u is NOT x86.
/etc/fstab it is