Operating System - HP-UX
1833757 Members
2103 Online
110063 Solutions
New Discussion

Re: allocating fixed tty name

 
Juan Chipoco
Contributor

allocating fixed tty name

Greetings,

I am a Linux user but in my new job there is a HP/UX 10x server with Windows9x
workstations and I have some doubts. I hope someone can help me.

I am trying to run a script that handles tty name allocation. I mean depending
on a remote telnet conection I want to allocate the same /dev/ttyxx to a fixed
IP (say 192.168.1.xx) always. Is possible to reserve /dev/ttyxx to specific
conections. Is there any way to do it with just Unix command and without
C-code.
By the other hand is there a cron.d deamon in HP/UX? and finally
what is the shell in HP/UX 10x ?.

Thanks,

Juan
Sorry for the english :)
Juan Chipoco
4 REPLIES 4
John Poff
Honored Contributor

Re: allocating fixed tty name

Hello Juan,

I don't know of any way to allocate the tty device file to an incoming connection.

There is a cron daemon in HP-UX. Try 'man cron' to read about it. The default shell in HP-UX is the POSIX shell.

Your english is fine!

JP
Patrick Wallek
Honored Contributor

Re: allocating fixed tty name

To answer your questions:

1) I know of no way to bind a tty to a specific IP address

2) Yes, HP-UX has cron. The daemon name is: cron

3) It depends. The default shell is the POSIX shell (/usr/bin/sh - man sh for more info). You do have the K-shell (/usr/bin/ksh), C-shell (/usr/bin/csh) and the Bourne shell (/usr/old/bin/sh) available for use.
Bill Hassell
Honored Contributor

Re: allocating fixed tty name

telnetd (gthe daemon that allocates the pty pair for communication) picks the first available. There is no way to pick a specific device. If you could, it would get really complicated when some other process (like rlogin) picks your favorite device file. Since a script can determine the name of the currently allocated tty device (man who), your script can store the name. By default, all stdout and stderr is directed to the controlling tty so direct reference to the tty device isnt really needed.

The standard shell for HP-UX is the POSIX shell (/usr/bin/sh). This shell is a superset of ksh (which is also a POSIX shell, just like bash). You can (as an ordinary user) change your shell using chsh.


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor

Re: allocating fixed tty name

No way to do what you want BUT it may not be necessary. When logged in, a user is assigned a pseudo tty connection, /dev/tty. I can do anything I like to my /dev/tty without affecting your /dey/tty eventhough they APPEAR to be the same device.

And yes, UNIX has a cron. /sbin/sh and /usr/bin/sh are POSIX shells (for your purposes, think of them as indistinguishable from Korn shells). DON'T even think about changing root's shell (which must be statically linked) or you will have an unbootable box.
If it ain't broke, I can fix that.