210
Chapter 15: Advanced Configuration
15.2 Advanced Portmanager
The portmangerprogrammanagestheConsoleServerserialports.Itroutesnetworkconnectiontoserialports,checks
permissions,andmonitorsandlogsallthedataowingto/fromtheports.
15.2.1 Portmanager commands
pmshell
The pmshell command acts similar to the standard tip or cucommands,butallserialportaccessisdirectedvia the
portmanager.
Example:Toconnecttoport8via the portmanager:
# pmshell -l port08
pmshell Commands:
Onceconnected,thepmshellcommandsupportsasubsetofthe'~'escapecommandsthattip/cusupport.ForSSHyou
mustprextheescapewithanadditional‘~’command(i.e.usethe‘~~’escape)
SendBreak:Typingthecharactersequence'~b'willgenerateaBREAKontheserialport(ifyou'redoingthisoverssh,
you'llneedtotype"~~b")
History: Typing the character sequence '~h' will generate a history on the serial port.
Quit pmshell: Typing the character sequence '~.' will exit from pmshell.
SetRTSto1runthecommand:pmshell--rts=1
Show all signals: # pmshell –signals
DSR=1DTR=1CTS=1RTS=1DCD=0
Read a line of text from the serial port: # pmshell –getline
pmchat
The pmchat command acts similar to the standard chatcommand,butallserialportaccessisdirectedvia the portmanager.
Example: To run a chat script via the portmanager:
# pmchat -v -f /etc/config/scripts/port08.chat < /dev/port08
Formoreinformationonusingchat(andpmchat)youshouldconsulttheUNIXmanpages:
http://techpubs.sgi.com/library/tpl/cgibin/getdoc.cgi?coll=linux&db=man&fname=/usr/share/catman/man8/chat.8.html
pmusers
The pmusers command is used to query the portmanager for active user sessions.
Example: To detect which users are currently active on which serial ports:
# pmusers
Thiscommandwilloutputnothingiftherearenoactiveuserscurrentlyconnectedtoanyports,otherwiseitwillrespondwitha
sorted list of usernames per active port:
Port 1:
user1
user2
Port 2:
user1
Port 8:
user2
Theaboveoutputindicatesthatausernamed“user1”isactivelyconnectedtoports1and2,while“user2”isconnectedto
bothports1and8