[comp.unix.questions] How to detect a login ?

kinawi@cs.qmw.ac.uk (Husam Kinawi) (06/07/90)

Although I have been a Unix front-end user for three years now,
it is my first time to interact directly with Unix from my
programs!!.

A login operation, I do think, is handled by some daemon or an
init forked process. (Am I right ?)
Now, is there anyway, ie. writting a shell script, a program,
etc... in such a way that the login daemon notifies a process
of mine that a person has logged in ?

My current solution to this problem, which I don't like,
is running a process that constantly reads the /etc/utmp
file and checks for user processes (ie. a user logged in!).
Can anybody help please ?!
Please e-mail any answers!!.

Thanks very much.

______________________________________________________________________________
Husam Kinawi (MSc. Student)    | ARPA    : kinawi@cs.qmw.ac.uk
Queen Mary & Westfield College | UUCP    : kinawi@qmw-cs.UUCP
Mile End Road                  | Tel     : 071- 975 5261
LONDON, E1 4NS, UK             | Fax     : 081- 980 6533
                               | Home Tel: 081- 980 7223 (After 23.00 GMT)