[mdlug] logout script?

David Lee Lambert as4109 at wayne.edu
Thu Dec 21 07:42:11 EST 2006


On Wednesday 20 December 2006 04:57 pm, Wojtak, Greg wrote:
> Either or... the problem is that since we exec the actual binary of the
> application, /usr/bin/ksh gets replaced, right?  So we can't do anything
> after that since when the users exit out of the telnet based app they get
> logged out of their session.  Does that make sense?

One possibility would be to watch all the Telnet processes with ptrace,  
allthough I'm sot sure if that works with unrelated processes.  Watch for the 
HUP signal and do whatever you want.

Another possibility would be to link the application with a custom version on 
exit() that does your cleanup work,  then calls the real exit().  Look for 
documentation on LD_PRELOAD.

Finally, since you probably need to do some C programming anyway,  why not 
rewrite the Telnet daemon to call a user-configured program after 
termination? 

-- 
David Lee Lambert ..... MA Comp Sci 2006 Wayne State
<as4109 at wayne.edu> or <lamber45 at msu.edu> or +1 586-873-8813
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mdlug.org/pipermail/mdlug/attachments/20061221/b34d69cd/attachment-0001.sig>


More information about the mdlug mailing list