hello folks! here's my situation: i've got two WTI RPB+ remote power switches (essentially a 5-port power strip which you can control via serial interface to make each of the ports switch on and off independently). they work fine; i plug a DB-9 cable into the back of my machine, fire up minicom, and i have full control. however, my eventual plan is to use these as fencing devices for a small RHCS cluster i'm building, and so the fencing process will need to be scriptable. RHCS wants to fence by invoking a "/sbin/ fence_<whatever>" script that uses Net::Telnet to connect to the fencing device and then enters the commands. so, it seems that what i need is a telnet server running on my CentOS box that, instead of calling /bin/login when someone connects, instead starts up a serial session (i'd prefer something more transparent than minicom, if possible). anyone have any good ideas on how to do this? i had been thinking of creating a user for this purpose whose shell was /usr/bin/minicom, but i'm open to other suggestions. thanks, steve --- If this were played upon a stage now, I could condemn it as an improbable fiction. - Fabian, Twelfth Night, III,v
On Wed, 2006-01-04 at 16:03, Steve Huff wrote:> however, my eventual plan is to use these as fencing devices for a > small RHCS cluster i'm building, and so the fencing process will need > to be scriptable. RHCS wants to fence by invoking a "/sbin/ > fence_<whatever>" script that uses Net::Telnet to connect to the > fencing device and then enters the commands. > > so, it seems that what i need is a telnet server running on my CentOS > box that, instead of calling /bin/login when someone connects, > instead starts up a serial session (i'd prefer something more > transparent than minicom, if possible). anyone have any good ideas > on how to do this? i had been thinking of creating a user for this > purpose whose shell was /usr/bin/minicom, but i'm open to other > suggestions.If it is obvious what the fence_ script is doing, you can probably replace it completely with a kermit script where you can chat equally well with serial or network connections. -- Les Mikesell lesmikesell at gmail.com
> so, it seems that what i need is a telnet server running on > my CentOS > box that, instead of calling /bin/login when someone connects, > instead starts up a serial session (i'd prefer something more > transparent than minicom, if possible). anyone have any good ideas > on how to do this? i had been thinking of creating a user for this > purpose whose shell was /usr/bin/minicom, but i'm open to other > suggestions.Assuming the network you're on is at least sort of secure, what about a netcat listener connected to /bin/cu ? If you wanted authentication on it as well, perhaps a small C program that netcat is connected to can do the authentication then spawn /bin/cu. As in: nc -l -p 23 -t -e /bin/cu -l <line> -s <speed> Just noticed my RHEL3 box doesn't have cu installed, but I'm betting it'd be in a uucp package somewhere. Change the port, change the line, speed, etc to match whatever you have running. Could always place netcat behind inetd and tcp_wrappers to secure down the inbound to a certain ip/subnet. Also, it looks like GNU Netcat actually has the ability to specify the source that's allowed.