Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    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!!

  2. #2
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414
    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 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  3. #3
    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.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414
    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 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  6. #5
    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?

  7. #6
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414
    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 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  8. #7
    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?

  9. #8
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414
    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 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  10. #9
    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

  11. #10
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    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.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •