FAQ
In Centos or RHEL terminal devices are created as /dev/pts/1 .../2 .../3 etc.
On Some others Unix they are defines as dev/tty01 ..../tty02 .../tty03
How do I can get theses terminals identites in Centos when I open a Terminal of any kind?


---
Michel Donais
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos-devel/attachments/20081229/e109106c/attachment.html

Search Discussions

  • Dag Wieers at Dec 30, 2008 at 1:18 am

    On Mon, 29 Dec 2008, Michel Donais wrote:

    In Centos or RHEL terminal devices are created as /dev/pts/1 .../2 .../3 etc.
    On Some others Unix they are defines as dev/tty01 ..../tty02 .../tty03
    How do I can get theses terminals identites in Centos when I open a Terminal of any kind?
    Do you mean this:

    [root at lisse root]# tty
    /dev/pts/5

    tty is used for console terminals
    pts is used for 'virtual/pseudo' terminals (like created by ssh or screen)

    There are other character terminal devices that are used for specific
    purposes, like ttyS for serial ports.

    --
    -- dag wieers, dag at centos.org, http://dag.wieers.com/ --
    [Any errors in spelling, tact or fact are transmission errors]
  • Michel Donais at Dec 30, 2008 at 1:48 am
    Subject: Re: [CentOS-devel] /dev/pts/??
    Do you mean this:

    [root at lisse root]# tty
    /dev/pts/5
    Yes, when I open a terminal or login in text mode
    via Telnet or SSh, the terminals ID is /dev/pts/1
    In Sco Openserver it was /dev/tty01

    My goal is to use tty's devices when I execute in a terminal
    and old SCO text application under Centos using linux_abi
    who stcck to identify a tty and getting is definition
    thru /etc/inittab and /etc/ttytype
    tty is used for console terminals
    pts is used for 'virtual/pseudo' terminals (like created by ssh or screen)

    There are other character terminal devices that are used for specific
    purposes, like ttyS for serial ports.
    I understand these above lines, but want to operate with tty's for this
    application

    ---
    Michel Donais
  • Dag Wieers at Dec 30, 2008 at 2:45 am

    On Mon, 29 Dec 2008, Michel Donais wrote:

    Subject: Re: [CentOS-devel] /dev/pts/??
    tty is used for console terminals
    pts is used for 'virtual/pseudo' terminals (like created by ssh or screen)

    There are other character terminal devices that are used for specific
    purposes, like ttyS for serial ports.
    I understand these above lines, but want to operate with tty's for this
    application
    A pts device is also a tty. I have troubles understanding what you want to
    achieve (and to be frank, none of your mails are explaining), but if the
    problem is that your application is SCO-centric and cannot work with pts
    devices, then you'll have to find the source code or ask your vendor.

    (Or simply log on to the console instead of using SSH ?)

    The way the tty command finds its tty is by following the
    /proc/self/fd/0 symlink.

    [root at moria root]# ls -l /proc/self/fd/0
    lrwx------ 1 root root 64 Dec 30 03:40 /proc/self/fd/0 -> /dev/pts/3

    Not sure what your application is doing to, try stracing it to find out.

    --
    -- dag wieers, dag at centos.org, http://dag.wieers.com/ --
    [Any errors in spelling, tact or fact are transmission errors]
  • Michel Donais at Dec 30, 2008 at 4:06 am

    A pts device is also a tty. I have troubles understanding what you want to
    achieve (and to be frank, none of your mails are explaining), but if the
    problem is that your application is SCO-centric and cannot work with pts
    devices, then you'll have to find the source code or ask your vendor.
    You've got it; the application is SCO-centric
    The application need to find a /dev/tty01 or more but can't work with
    dev/pts/1.

    The developper is no more active and I don't have the sources.
    One of my last resource is to find a way to start a terminal and have Centos
    allowing me to start the application on a terminal as tty instead of a
    pseudo-terminal.
    The other way is to re-install an SCO Server wich is not a small task for
    the time we have to recover some archived data.
    (Or simply log on to the console instead of using SSH ?)
    This haven't been tried, and I will to morrow; but our best will be to use
    it a text terminal.
    Not sure what your application is doing to, try stracing it to find out.
    There is no possibility to trace at start-up.

    ---
    Michel Donais
  • Dag Wieers at Dec 30, 2008 at 4:27 am

    On Mon, 29 Dec 2008, Michel Donais wrote:

    A pts device is also a tty. I have troubles understanding what you want to
    achieve (and to be frank, none of your mails are explaining), but if the
    problem is that your application is SCO-centric and cannot work with pts
    devices, then you'll have to find the source code or ask your vendor.
    You've got it; the application is SCO-centric
    The application need to find a /dev/tty01 or more but can't work with
    dev/pts/1.
    If you run the application as root, you could create a device node that is
    identical to the real device as /dev/tty01 (since Linux uses /dev/tty1
    they will not clash).

    This can only work if you understand how the application is constructing
    /dev/tty01 (I am sure this is not hardcoded, because that would not even
    work on SCO).

    The developper is no more active and I don't have the sources.
    One of my last resource is to find a way to start a terminal and have Centos
    allowing me to start the application on a terminal as tty instead of a
    pseudo-terminal.
    Even on SCO the application needs to figure out its own tty. So there
    should be a way to influence its decision. I don't even understand why it
    would go with /dev/tty01 over an SSH connection, unless it is hardcoded as
    a silly fallback default if all other measures have failed.

    Finding what these other measures are, may be the source of a solution ?

    (Or simply log on to the console instead of using SSH ?)
    This haven't been tried, and I will to morrow; but our best will be to use
    it a text terminal.
    You can also tru using 'conspy' to take over the real /dev/tty1 from an
    SSH or screen session and then start the SCO application. However if the
    SCO application expects /dev/tty01 then that would fail similarly.

    Creating a device node identical to the current tty is probably the best
    way forward if it really is /dev/tty01. You can do this simply by doing:

    cp -aLv /proc/self/fd/0 /dev/tty01

    or maybe a symlink would work as well:

    cp -av /proc/self/fd/0 /dev/tty01

    The advantage if a symlink is simply that you have a visual confirmation
    to what tty it is linking without having to decipher the major and minor
    device numbers.

    Not sure what your application is doing to, try stracing it to find out.
    There is no possibility to trace at start-up.
    Man, aren't you glad that your SCO days are (almost?) (finally?) over ? ;-)

    --
    -- dag wieers, dag at centos.org, http://dag.wieers.com/ --
    [Any errors in spelling, tact or fact are transmission errors]
  • Hugo van der Kooij at Dec 30, 2008 at 9:13 pm

    Michel Donais wrote:
    A pts device is also a tty. I have troubles understanding what you want to
    achieve (and to be frank, none of your mails are explaining), but if the
    problem is that your application is SCO-centric and cannot work with pts
    devices, then you'll have to find the source code or ask your vendor.
    You've got it; the application is SCO-centric
    Didn't you burn them all just like you did burn all your gif files?

    Hugo.

    - --
    hvdkooij at vanderkooij.org http://hugo.vanderkooij.org/
    PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc

    A: Yes.
    Q: Are you sure?
    A: Because it reverses the logical flow of conversation.
    Q: Why is top posting frowned upon?
    Bored? Click on http://spamornot.org/ and rate those images.

    Nid wyf yn y swyddfa ar hyn o bryd. Anfonwch unrhyw waith i'w gyfieithu.
  • Hugo van der Kooij at Dec 30, 2008 at 9:24 pm

    Michel Donais wrote:
    In Centos or RHEL terminal devices are created as /dev/pts/1 .../2
    .../3 etc.
    On Some others Unix they are defines as dev/tty01 ..../tty02 .../tty03
    How do I can get theses terminals identites in Centos when I open a
    Terminal of any kind?
    Try to read this:
    http://en.wikipedia.org/wiki/Pseudo_terminal
    http://en.wikipedia.org/wiki/Tty_(Unix)

    You could try to write a wrapper that can create the dummy link to
    please that patent infested historic application. (SCOrne intended.)

    But I guess the application is quite old as pseudo terminals are around
    for a long time.

    Hugo.

    - --
    hvdkooij at vanderkooij.org http://hugo.vanderkooij.org/
    PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc

    A: Yes.
    Q: Are you sure?
    A: Because it reverses the logical flow of conversation.
    Q: Why is top posting frowned upon?
    Bored? Click on http://spamornot.org/ and rate those images.

    Nid wyf yn y swyddfa ar hyn o bryd. Anfonwch unrhyw waith i'w gyfieithu.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos-devel @
categoriescentos
postedDec 30, '08 at 12:26a
activeDec 30, '08 at 9:24p
posts8
users4
websitecentos.org
irc#centos

People

Translate

site design / logo © 2023 Grokbase