Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I connect to a unix network and was curious if there was
a script or a program that would automatically relog or reauthenticate me at time inervals so that the connection is not lost when
they boot idle users.

hi there,
yours been a common problem as the unix admin guys love to kill sessions which are idle for long times. :)Anyways to get out of it, try somehting like this...
while true
do
tty=`tty`
touch $tty
sleep 60(or whatver you desire, depends upon how much time is set before your login is off)
done &the & in end means that the process shall run in background when invoked. You could put this script in your .profile also so that you can skip the additional step of starting this script when you are logged on to the server.
One problem though, you will find this sleep job running all the time in background when u do a `ps`. So dont be worried.
~deeps.

Wow thats what Im looking for...but unfortuneatly Im
not a programmer Im sorta very novice at that I stick to
the artsy computer stuff so if u read this could u or
someone else maybe try and put it more in
english...though Ill look into what u said a more
comprehensive explanation would be helpful thanks :-[

Okies let gets this way...
while true
do
tty=`tty`
touch $tty
sleep 60(or whatver you desire, depends upon how much time is set before your login is off)
done &The first line...
while true means that the loop shall run infinitely...Second, the target to be achieved is that you terminal doesnt log out anytime.. even if it is left idle for quite some time...
So where does this information rest.. The place to know this is your terminal only.
When you open a new login, you actually log on to one of nodes which are identified by unix already during its startup.
So when you open a new login, you get hooked on to one of these terminals, (ttys) and the way to find out where you are connected presently is by giving a the command tty.
so tty=`tty` puts the output of tty your terminal information in tty.
Now all you need to do is to update the file as unix interpretes most of the things in terms of files only...You touch this file.. and go to sleep :-)
(i.e you allow the process to stop or sleep in backgrouond for sometime... as continously running is the loop os no advantage but rather consuming your crucial CPU resources..So sleep 60 means... allow process to go dormant for 60 seconds or you could give any number like 300(5minutes), etc depending upon what time has been set by the root to logout your terminal after an elapsed time.
So say, if its been set as 5 min then, you may put it to sleep for 299 sec and then evoke the job to touch tty and go to sleep again...
I just think all that might sound confusing but try to understand what is the significance of touch tty and everything goes in smoothly...
~deeps

LOL ok so last question and then you'll be free of me
forever.... How do I initiate it the first time...like how do
I initiate it...are those all commands that I seperately give
while in the Terminal or do I put it somewhere and
somehow call it....sorry :-)

I think I got it. I made it a file in vi then called it as a bg
function and its there under ps so does that mean its
doing its job?

Ok if the above process is correct on how I did it ... it
didnt work... maybe I didnt explain it quite right... I have
to authenticate for Other internet sevices..ie AIM and
stuff.. can I automate that process?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |