Copyright © 2001 Data Deliverance Pty Ltd
This README, patch and associated utility programs (if any) are released under the GNU Public License Version 2.

Using X11 with the symlink patch

The symlink patch gives each user a separate /tmp directory. This can cause problems for things like X-windows that share files in /tmp. Below is a description of how to patch a normal RedHat 6.2 system to use X11 properly in conjunction with the patch. This should work, perhaps with slight modifications on other Linux systems. To make these changes, you may need to be in run level 3 or s rather than 5, which starts the X login system (which won't work after you have installed the patch). To do this on a standard system running lilo, enter this at the lilo: prompt:

linux -s

When it asks you what run level you want, enter 3.

To get it working, you make a directory (/X11-tmp is used here, but it could be any other directory) to contain the shared files that X needs. To use any other directory, just substitute the name for /X11-tmp. Make sure that all users can access the directory that it is in (e.g. / in this case).

  1. In /etc/X11/prefdm, put the initialisation code after the PATH= statement near the top:
    rm -rf /tmp/.X11-unix
    mkdir /X11-tmp
    chown gdm /X11-tmp
    chmod 700 /X11-tmp
    ln -s /X11-tmp /tmp/.X11-unix
    

    This sets up things for root to run X and stick the socket where others can see it.

  2. In /etc/X11/xdm/GiveConsole, put this after the other chown(s):
    chown $USER /X11-tmp
    chmod 700 /X11-tmp
    

    and at the end put:

    su - $USER -c 'ln -s /X11-tmp /tmp/.X11-unix' > /dev/null 2>&1
    

  3. In /etc/X11/xdm/TakeConsole, add this after the other chown(s)
    chown gdm /X11-tmp
    

    This is important, and things will break if you leave this out, because the login window stuff is run as user gdm. If you want to clean up the link at the end of this file, you can put something like this (root still needs the link, as it's running the X server) :

    if [ x$USER != xroot ]; then
      su - $USER -c '/bin/rm -f /tmp/.X11-unix' > /dev/null 2>&1
    fi
    

  4. /tmp/.font-unix is not needed if you use a font path with tcp in it (e.g. tcp/localhost:7100) instead of a unix:/ path. To accomplish this, edit /etc/X11/XF86Config, and change the line reading
    FontPath "unix:/-1"

    to read

    FontPath "tcp/localhost:7100"

    If don't have a line like that, but instead have a FontPath with lots of file paths following it, you don't need to edit anything, and can stop now. Otherwise, you may also have to edit the xfs startup script, to make it listen on this port. Edit /etc/init.d/rc.d/xfs, and look for a line (probably near the end) looking like this:

    daemon xfs -droppriv -daemon -port -1

    replace the "-port -1" with: "-port 7100"

    After you have made these changes, go to run level 5 (on RedHat) or do the equivalent on your system to startup the X login.


    Matthew Donaldson <matthew@datadeliverance.com>
    Last modified: Thu Apr 26 13:59:05 CST 2001