set_utmp is a little utillity used to create and remove utmp entries.
i.e. changing the Information displayed by commands like 'who' or 'w'.

(For the program to work properly the uid that executes it needs to have
 write-access to your systems utmp-file.)

The original purpose is to create an utmp-entry for a pseudo-device, that can
be searched for by certain programs.
For example: upon login via a xterminal create an entry for a tty called
	(for example) 'X1'. This entry can then be used to determin who is
	 'physically' logged in at the xterminal)


Compilation:
	
This Software has been compiled on the folowing platforms:

	HP-UX 9.01
	IRIX 5.2
	ULTRIX 4.1

On the above it has been tested successfully.

	SunOS 4.1.1
	SunOS 5.3 (Solaris)

No testing could be done on these systems (due to lack of root access ;)
But the source compiled and executed just fine. If the programm actually
does what it is supposed to do couldn't be determined.

To compile, simply type 'make' at your shell-prompt.
 (only for Solaris you have to do an explicit 'make Solaris')


Note for SGI IRIX < 5.2:
 You may have to change the UTMP_NAME and TMP_UTMP_NAME defines
 in set_utmp.c . The only important thing is, that both files are on
 the same filesystem.


Examples for usage:

In case you don't get an 'X0'-tty entry in your utmp-file when you log in
via X at the console, put this into your xdm-Xstartup and xdm-Xreset scripts.
(those scripts are executed with uid 0 (=root)!)

Xstartup:

   if [ -x /usr/local/bin/set_utmp ] ; then
      /usr/local/bin/set_utmp $USER
   fi


Xreset:

   if [ -x /usr/local/bin/set_utmp ] ; then
      /usr/local/bin/set_utmp
   fi


Say you have a host with 2 xterminals connected.
Make sure xdm executes the Xstartup and Xreset scripts upon login/logout at
an xterminal.

Putting something similar to the following lines into your xdm-config
might do the trick if you have problems with it.

DisplayManager.*.startup:       /usr/lib/X11/xdm/Xstartup
DisplayManager.*.reset:         /usr/lib/X11/xdm/Xreset


Put something similar to the following into your Xstartup-script

case $DISPLAY in
   xterminal1*)
      if [ -x /usr/local/bin/set_utmp ] ; then
         /usr/local/bin/set_utmp $USER -t X1
      fi
      ;;
   xterminal2*)
      if [ -x /usr/local/bin/set_utmp ] ; then
         /usr/local/bin/set_utmp $USER -t X2
      fi
      ;;
esac


and something like this into your Xreset-script

case $DISPLAY in
   xterminal1*)
      if [ -x /usr/local/bin/set_utmp ] ; then
         /usr/local/bin/set_utmp -t X1
      fi
      ;;
   xterminal2*)
      if [ -x /usr/local/bin/set_utmp ] ; then
         /usr/local/bin/set_utmp -t X2
      fi
      ;;
esac
