How to retrieve another termianl

IRIX and IRIX software discussion including open source and commerical offerings.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
uunix
Donor
Donor
Posts: 1808
Joined: Sun Mar 27, 2011 12:48 pm
Location: Stourbridge / England / UK

How to retrieve another termianl

Unread postby uunix » Wed Dec 09, 2015 1:40 pm

I need a reminder..
OK, so I've telnet into another machine and run cu -l /dev/ttyd1 to get a session to an o2.
I've telnet'ed again to the other machine and run ps -ef to get the session lists.
I can see the original session is run on pts/0 and I am currently on pts/1.

Unless I'm thinking of retrieving a back ground job, I'm sure I can switch to the pts/0 session ?
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------

User avatar
vishnu
Donor
Donor
Posts: 3183
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: How to retrieve another termianl

Unread postby vishnu » Wed Dec 09, 2015 2:22 pm

Uh, you're trying to do what now? Why not just open terminal windows from the other machines you're telneted into, on the machine you're telneting from? You probably already know this but for the sake of completeness, if you're going to telnet from machine1 to machine2 and machine3, you do "xhost machine2" and "xhost machine3" (on machine1), then, once you're telneted into machine2 you do "setenv DISPLAY machine1:0.0", issue a command to launch your favorite terminal emulator, its window opens on machine1, telnet to machine3 and do the same setenv and launch your second favorite terminal emulator there, problem solved! :mrgreen:

Disclaimer: If you're using BASH (like me) you'd set the DISPLAY environment variable using export, like so: "export DISPLAY=machine1:0.0" :roll:
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:

User avatar
uunix
Donor
Donor
Posts: 1808
Joined: Sun Mar 27, 2011 12:48 pm
Location: Stourbridge / England / UK

Re: How to retrieve another termianl

Unread postby uunix » Wed Dec 09, 2015 2:32 pm

ah.. ok.. sorry, looking at that, it's a kacky explanation.
I telnet (from Octane) into a headless Indy that is connected via serial to an o2 that I need to run from the PROM. At the Indy prompt I cu to the o2.

All good so far.

Say I want to turn off the Octane, but leave the cu running on the Indy...

I come back tomorrow and telnet again from the Octane to the Indy.. I then need to get back pts/0 (the original telnet session).

No X involved.. just telnet.

EDIT.
I don't think it can be done: http://www.unix.com/unix-for-dummies-questions-and-answers/39105-switching-active-pts.html
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------

robespierre
Posts: 1568
Joined: Mon Sep 12, 2011 2:28 pm
Location: Boston

Re: How to retrieve another termianl

Unread postby robespierre » Wed Dec 09, 2015 3:19 pm

When you cu from a telnet session, the cu is a child of (a child of...) telnetd. When you close the telnet session, the (fork of) telnetd terminates, and that normally kills all of its children. But in some cases, they can decide to keep living ("nohup"). This may be an option to the child process (cu in this case). After the session is closed, the parent-child relationship is lost forever: there is no way to make a new telnet session the parent of an existing cu process.
The way this problem is solved is by using session-management tools like SCREEN. The screen process is created as the session leader, and the cu is always the child of screen. Each screen session creates a Unix domain socket, and you can connect to that session in multiple (sequential or simultaneous) remote telnet sessions.
:PI: :O2: :Indigo2IMP: :Indigo2IMP:

User avatar
dexter1
Moderator
Moderator
Posts: 2743
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: How to retrieve another termianl

Unread postby dexter1 » Wed Dec 09, 2015 3:29 pm

It can be done if you use terminal multiplexing with screen and the built-in options for detach and resume.
If you install neko_screen (or a fw or other version) on the headles indy, you can do the following:

- telnet into the headless Indy
- start screen. It will start and will look just like your standard console.
- run cu or minicom or what you prefer to start a serial connection to the O2
- Do your stuff on the O2, like starting a PROM dump
- detach the screen with <ctrl>-<a> <d> (so simultaneously press the <ctrl> and <a> button, release them and then press <d>)
- your screen session is now detached from the login session. So now you can logout from the headless indy.

- next dat log into the headless indy
- type screen -r and you're back :)

EDIT: ^5 Robespierre :)
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP:


Return to “IRIX and Software”

Who is online

Users browsing this forum: No registered users and 2 guests