Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Applications
Reload this Page [SOLVED] ssh-ing into currently running app
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Applications I cant get "X" app to work... also discussion about linux programs.

Closed Thread
 
Thread Tools Display Modes
Old 07-22-2008   #1 (permalink)
meeveryday
Just Joined!
 
Join Date: Aug 2007
Posts: 9
[SOLVED] ssh-ing into currently running app

Hi all,

I have been scouring the web to try and find an answer to this but as I am quite new to the ssh thing, I am not even sure I am asking the right question.

I have a debian server that is imperative that stays as low resource as possible. Hence, when it boots it goes to the console and does not startx. Actually it just sits waiting for the User and PW.

During the boot process I am going to start an app that I want to be able to ssh in to see. I am getting that going at the moment and running that the init.d way.

So my question is, can I assign an app a DISPLAY level or something that will correspond with an ssh command so I can see it remotely?

Or if anyone has any better ideas, i'm open. I just don't really want to startx or a window manager or anything like that because of need to keep resource usage low.

TIA ALOT!!
meeveryday is offline  
Old 07-22-2008   #2 (permalink)
smolloy
Linux Guru
 
smolloy's Avatar
 
Join Date: Apr 2005
Location: San Francisco, CA, but from Belfast, N.Ireland.
Posts: 1,819
Can you tell us what app you're interested in observing via ssh?
__________________
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 7300 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
smolloy is offline  
Old 07-22-2008   #3 (permalink)
meeveryday
Just Joined!
 
Join Date: Aug 2007
Posts: 9
It will be a terminal session running a rendering program. I need to be able to see the ever changing output to watch for errors and the like.
meeveryday is offline  
Old 07-22-2008   #4 (permalink)
smolloy
Linux Guru
 
smolloy's Avatar
 
Join Date: Apr 2005
Location: San Francisco, CA, but from Belfast, N.Ireland.
Posts: 1,819
Can you redirect the output from this program to a file, which you can then read at your leisure, or watch using
Code:
tail -f outputfile.txt
?
__________________
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 7300 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
smolloy is offline  
Old 07-22-2008   #5 (permalink)
meeveryday
Just Joined!
 
Join Date: Aug 2007
Posts: 9
Hmm that sounds like a simple idea, I like that! Is there a command you know of to pipe the terminal session to a text file?
meeveryday is offline  
Old 07-22-2008   #6 (permalink)
smolloy
Linux Guru
 
smolloy's Avatar
 
Join Date: Apr 2005
Location: San Francisco, CA, but from Belfast, N.Ireland.
Posts: 1,819
When you run the app, run it like this
Code:
application-name >> ~/outputfile.txt
(Obviously replacing "application-name" with the name of your app!)

This is called redirection -- there'll be a ton of information on google on it.
__________________
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 7300 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
smolloy is offline  
Old 07-23-2008   #7 (permalink)
meeveryday
Just Joined!
 
Join Date: Aug 2007
Posts: 9
ok that seems to be working but it is not outputting live if you know what I mean. It only updates the txt file after it is ended? But when I first tried it I am sure it was . any ideas?
meeveryday is offline  
Old 07-23-2008   #8 (permalink)
smolloy
Linux Guru
 
smolloy's Avatar
 
Join Date: Apr 2005
Location: San Francisco, CA, but from Belfast, N.Ireland.
Posts: 1,819
Redirection should happen live. If you view the file with the following, you should be able to watch it update live,
Code:
tail -f ~/outputfile.txt
__________________
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 7300 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
smolloy is offline  
Old 07-23-2008   #9 (permalink)
meeveryday
Just Joined!
 
Join Date: Aug 2007
Posts: 9
Yeah so I have tried that but I think the problem is that the redirection is only outputing certain things, and not everything and the program that is running must work in such a way that it does not go to a new line. or something?? i'm struggling to find out why really? Any ideas?? tia
meeveryday is offline  
Old 07-23-2008   #10 (permalink)
i92guboj
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 994
Try to redirect both stdout and stderr:

Code:
progname >/var/log/logfile.txt 2>&1
That should put everything that the program spits out to the console into logfile.txt

Then you can open ssh like this:

Code:
ssh user@server 'tail -f /var/log/logfile.txt'
If the program is going to run in X in graphical mode or something then you will need vpn or something like that, I guess. It all depends on what exactly do you need.
i92guboj is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 01:19 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0