From SE-Times
Author: Richard Pettit
Subject: XDM Setup

Ever see how SGI machines come up in the window system?
Ever get bit by a customer asking you "Why can't Sun do that?"?

Well, Sun *can* do that. We've been able to for a long time. It's controlled by a program called "xdm".

WHAT IS XDM

If you don't know what xdm is, it's like a login process that brings up the X server and prompts you for a login and password inside of a "login widget" instead of the tty based login process that we use by default.

You can change the colors of the login widget text and background, set the background of the screen to a color or bitmap or image or whatever you like.

The change to bring xdm up is very easy and I recommend using this on any loaner or demo gear. It makes the system look better and it's easier to use.

USING XDM ON SOLARIS 2.4

The steps to start xdm under 2.4 are (as root):

  1. edit /etc/inittab (make sure you save the original version of inittab) change the last line to:
    co:234:respawn:/usr/openwin/bin/xdm -nodaemon
  2. from the root shell (NOT IN OpenWindows) enter:
    init q && exit

It's best to do this on a machine that is accessible from the network. If the only account on the machine is root, make sure you uncomment the CONSOLE=/dev/console line /etc/default/login first otherwise, you'll end up booting from cdrom to fix any potential problems.

CHANGING THE LOOK OF XDM

What you'll see is the default xdm look. If you want to alter how xdm looks or functions, all of the files that you need to edit are in /usr/openwin/lib/xdm. For instance, if you want to change the text and background colors of the login widget, edit the file Xresources. There are two lines:

*Foreground: white *Background: grey

which can be changed to more attractive colors. I use:

*Foreground: yellow2 *Background: midnightblue

You can also change the greeting banner:

xlogin*greeting: Welcome To OpenWindows

to "Welcome to Hostname" or whatever.

To set the background of the screen, modify the file Xsetup_0. I use
xsetroot -bitmap /usr/openwin/share/etc/workspace/patterns/swirl2.xbm -bg \#b298bf -fg \#e5b7b7
but you can use any of the bitmaps in that directory, or create your own or use xsetbg to load an image or whatever.

KILLING XCONSOLE

One of the features of xdm is that it brings up xconsole along with the login widget. When a user logs in, xconsole *does not* go away. This can be fixed by editing the file GiveConsole. I have:

pid=`/usr/ucb/ps axc | fgrep xconsole | awk '{ print $1 }'` if [ -n "$pid" ]; then kill $pid fi

That way, cmdtool -C won't have a fit when it's started.

USING XDM ON SOLARIS 2.3

The files in the /usr/openwin/lib/xdm directory are different on Solaris 2.3 as compared to 2.4 but still work. There are some differences though to make xdm work like 2.4 on 2.3.

  1. edit /etc/inittab (make sure you save the original version of inittab) change the last line to:
    co:234:respawn:/usr/openwin/bin/xdm -nodaemon >/dev/console 2>&1
  2. from the root shell (NOT IN OpenWindows) enter:
    init q && exit

The foreground and background colors for the login widget may not change on some machines. I've seen it work on cg6 but not work on cg3. If you change the *Foreground and *Background resources and the login widget still has the wrong colors, you may need to remove the #ifdef COLOR and just define the colors outright:

*Foreground: yellow2 *Background: midnightblue xlogin*Foreground: yellow2 xlogin*Background: midnightblue

OTHER ISSUES

  1. Application Error Messages
    Error messages from tools brought up by olwm are ordinarily sent to the console. Under xdm, they are logged to the file /var/tmp/xdm-errors. If something isn't working correctly, you may want to look there first.
  2. User Environment
    When starting up, if the script Xsession does not find a .xinitrc in the user's home directory, then an xterm is started and that composes the entire environment. If you copy /usr/openwin/lib/Xinitrc to ~/.xinitrc and change the mode to 755, it will run start your environment as always with a caveat.

    Normally, when you log in, your entire environment is set up in the shell before running openwin. In the xdm environment, the window system is started before any environment is created and the first environment is in the xterm or shelltool or cmdtool that is started under the X server. Therefore, if you have a customized .openwin-init, .openwin-menu, or .xinitrc that depends on variables set in your .cshrc, .login, or .profile then you will find things don't work as expected. This is especially true for anyone using the softdist menus since the softdist .login file defines the OLWMMENU environment variable to use the softdist menu. Without this, olwm defaults to the wrong menu.

    If you want to set any environment variables, such as OLWMMENU, you can set them in the Xsession file. Specifically, you will *want* to set the LOGNAME variable. On 2.3, the Xsession file is fairly brief. On 2.4 it looks more like the openwin script. In either place, you can add

    LOGNAME=`/bin/id | /bin/sed -e 's/).*$//' -e 's/^.*(//'` export LOGNAME

    to get the LOGNAME variable defined. If you have a heavily customized environment (as I do) it can get very strange very quickly.

  3. Xlock
    Another issue is that xlock doesn't like working from the olwm root menu. The message written into the /var/tmp/xdm-errors file says:

    xlock: can't get the user password. Exiting ... You need to run xlock in setuid root mode on your local machine. Contact your system administrator.

    This is a confusing message since xlock *is* setuid root. I've overcome this problem by grabbing the latest version of xlock from ftp.x.org. It not only does not exhibit this problem but also has a lot more really neat modes available (try xlock -mode bat; it's pretty funny). This version of xlock can be obtained from ftp://newstop.ebay/sun/tech-mktg/misc.