TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:10915] Asking the Impossible?



Jonathan Kline wrote:
> 
> OK, I tried Adding
>         7:2345:respawn:/usr/bin/telnet <hostname> to /etc/inittab
> Then I rebooted the machine, And It works, except it keeps respawning even
> before you get to login, so then you get a message that says process id is
> spawning to fast, canceled for 5 minutes?

Hmmm. The target host is probably set to time out a login after X amount
of time, causing telnet to exit, init respawns it, rinse, repeat...
Could try to disable the timeout, but then if the target ever goes down,
telnet will respawn like mad as well. Best thing is to write a little
wrapper script, that does something like "Press a key to connect."
before running telnet...

Pseudocode. Not sure how to do this in shell, and perl seems like
overkill...

#!/usr/bin/dwim
while(1)
{
  echo "Press a key to connect to $*."
  sitandwaitforkeywheefun...
  telnet $*
}

Also, note you haven't actually done anything to tell it to run on tty7.
Try open. Make sure the rpm is installed, then something like
7:2345:respawn:/usr/bin/open -c 7 /usr/local/bin/niftytelnetscript
wherever.com