Operating System - HP-UX
1826341 Members
4016 Online
109692 Solutions
New Discussion

Re: disable terminal port

 
SOLVED
Go to solution
scott_170
Occasional Advisor

disable terminal port

Hello,

We have a need to setup a terminal port with no getty. Apparently whenever I set this up in SAM it is enabled, for the speed I want. (2400B) when I got to inittab and alter it to turn getty off. I re-initialize the inittab file and get 300B. I need it to stay at 2400B any help here?

Thanks Scott
11 REPLIES 11
Ron Kinner
Honored Contributor

Re: disable terminal port

You need to look at the file /etc/gettydefs

In my 11.0 there is:

H # B9600 SANE CLOCAL CS8 IXANY TAB3
# B9600 SANE CLOCAL CS8 IXANY TAB3
#login: #H

which is to be used for a hardwired terminal.

IF we modify it for 2400 and give it a different letter it would look like this:

J # B2400 SANE CLOCAL CS8 IXANY TAB3
# B2400 SANE CLOCAL CS8 IXANY TAB3
#login: #J

If you copy this and add it to the bottom of a copy of gettydefs you can check the sanity of your changes with getty -c filename.

Now copy the old gettydefs to a safe place and replace it with your new version. Then change your initab entry to read something like:

ttp1:234:respawn:/usr/sbin/getty -h tty0p1 J

(Using the appropriate tty, of course)

It should pick up the J option and stay at 2400. See the man for getty and gettydefs.

Ron
Ron Kinner
Honored Contributor

Re: disable terminal port

I just reread your question. In addition to the gettydefs changes you may want to remove the login from the gettydefs definition J so that it does not try to login when you fire it up.

Ron
Michael Tully
Honored Contributor

Re: disable terminal port

You'll need to check your entry corresponds to the contents in /etc/gettydefs file.

ttp1:234:respawn:/usr/sbin/getty -h tty0p1 2400

Using this example, you should have an entry in /etc/gettydefs for 2400
Anyone for a Mutiny ?
Michael Tully
Honored Contributor

Re: disable terminal port

I've seen what Ron has mentioned as well.

I'm not sure why you would want the getty off ... but ...

ttp1:234:off:/usr/sbin/getty -h tty0p1 2400


Anyone for a Mutiny ?
scott_170
Occasional Advisor

Re: disable terminal port

Thanks, I had already setup the following in gettydefs...

F # B2400 SANE CLOCAL CS8 IXANY TAB3
# B2400 SANE CLOCAL CS8 IXANY TAB3
#login: #F

Per the suggestions I removed "#login:" and left "#F"

in inittab I have tried many things:

b9:3:off:/usr/sbin/getty -h tty2a13 F

and

b9:3:off:/usr/sbin/getty -h tty2a13 24000

Well, still no dice. If it's enabled, stty shows 2400B when it is disabled it drops to 300B.

I need this disabled for a hand held inventory scanner device. It usees a disabled port, works fine in AIX, SCO.

Thanks again...
Darren Prior
Honored Contributor
Solution

Re: disable terminal port

Hi Scott,

A terminal port without a getty is purely a device file. The getty is used for providing a login, which you don't need. It also follows that if you don't need a getty, you won't be using gettydefs either.

The default baud rate for a port is 300, if you need to change this you could use stty, and a sleep command - in the same way as with serial printers. However, it's common for the application that's accessing the port to set the baud rate. What are you actually using to access the port? Kermit, cu, some 3rd party code? I did deal with someone a couple of years back that had a dual head barcode scanner, they were using kermit to pull the barcodes into a file which was then sent to their database.

regards,

Darren
Calm down. It's only ones and zeros...
Yuri Kozlov
Advisor

Re: disable terminal port

In /etc/inittab comment line with getty on need port and
kill -HUP 1
Tim Sanko
Trusted Contributor

Re: disable terminal port

Assuming it is either a symbol or a Telxon, I would suggest removing the line from the gettydefs and placing a script that would use stty to set the speed and the line parameters.

Unless I wrote a C program to poll the port and then I could set the speed there. If you are writing C you could update Oracle with PROC or other such technique.

Tim
scott_170
Occasional Advisor

Re: disable terminal port

Okay I have checked other boxes (2) with HP-UX (all are 10.20) They have ports set up that are disabled, that retain 2400B.

I have tried setting up a port there and get the same results. It could be the way I am adding the port or disabling it.

I have added it through SAM and I have added it by MKNOD. The only way I can see to disable it is to edit the inittab file (changing "respawn" to "off")
There must be another way which I am not aare of.
scott_170
Occasional Advisor

Re: disable terminal port

Okay I have checked other boxes (2) with HP-UX (all are 10.20) They have ports set up that are disabled, that retain 2400B.

I have tried setting up a port there and get the same results. It could be the way I am adding the port or disabling it.

I have added it through SAM and I have added it by MKNOD. The only way I can see to disable it is to edit the inittab file (changing "respawn" to "off")
There must be another way which I am not aware of.
scott_170
Occasional Advisor

Re: disable terminal port

AAAAH! I found the sleep scripts that were setting the bauds for the "disabled" ports... Grrrr...

Darren clued me into it.

Thanks everybody!