making the proper utmp and wtmp entries

2007-12-25 8:11:00

My original question :

> I have just installed the X Display Manager (SUNOS 4.1.3, OW3),

> using this simple Xstartup:

>

> #! /bin/sh

> #

> # Xstartup

> #

> # This program is run as root after the user is verified

> #

> if [ -f /etc/nologin ]; then

> exit 1

> fi

> exit 0

>

> How can I modify it to make the proper utmp and wtmp entries ?

> Should I write a "c" routine ?

> Is there any SunOS utility that allow me to create a utmp record in the

> right format ?

The best solution seems to be sessreg, that is ftp-available. For example

I have ftp'ed it from ftp.germany.eu.net ( directory /pub/X11/contrib ).

The installation is very easy.

The only thing you should pay attention is to have the standard X11R5 files

Xfuncs.h and Xosdefs.h in /usr/include/X11 if you are running OW3

on X11R4 (like me) and after you can compile the source without any problem.

I have modified my Xstartup and my Xreset as shown below:

#! /bin/sh

#

# Xstartup

#

# This program is run as root after the user is verified

#

# Check if logins are disabled

#

if [ -f /etc/nologin ]; then

        exit 1

fi

#

# Register the login session on the server machine

#

sessreg=/usr/openwin/lib/xdm/sessreg

$sessreg -a -l XDM -h $DISPLAY -x /usr/openwin/lib/xdm/Xservers $USER

touch /dev/XDM

exit 0

#!/bin/sh

#

# Xreset

#

# Delete the session from utmp/wtmp

#

sessreg=/usr/openwin/lib/xdm/sessreg

$sessreg -d -l XDM -h $DISPLAY -x /usr/openwin/lib/xdm/Xservers $USER

P.S. /dev/XDM is a dummy device linkek with /dev/null to keep finger

an w happy.

They work well !! :-)

Another solution has been suggested me from Rex Walters ( walter@msai.com ),

who has written two interesting perl script "asc2wtmp and wtmp2asc"

to update the wtmp entries. I haven't included them in this summary: if you are

interested in, please don't hesitate to contact me.

Many thanks to :

wojsyl1@appli.mimuw.edu.pl (Wojtek Sylwestrzak)

ups!kalli!kevin@fourx.aus.sun.com (Kevin Sheehan {Consulting Poster Child})

Michael Assels <mjassels@cs.concordia.ca>

Gilbert E. Detillieux <gedetil@cs.umanitoba.ca>

Carmine Di Biase Cardone <carmine@usb.ve>

walters@msai.com

===========================================================================

Massimo Mentrasti, Systems Administrator | e-mail: mentrasti@ssi.it

Space Software Italia | phone: +39 99 4701-430

Viale del Lavoro 101 | fax: +39 99 425044

I-74100 Taranto - Italy |

===========================================================================

Comments

Got something to say?

You must be logged in to post a comment.