Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to compile and run a program remotely. However, I'd like to this within a screen and also I'd like to run this using grid engine on another node after I ssh. Currently I have:

ssh me@server screen -R session 'qlogin; cd path; mvn options program'

This basically works, but I get a message saying that I must be connected to a terminal. I read about this and added the -t option to ssh. With that, my command breaks: it seems like I ssh over, screen starts, then doesn't know about the "mvn" command and terminates my session.

I'm wondering why this is happening and how to correctly launch jobs from my local machine, within a screen, on a remote node while using grid engine.

share|improve this question

migrated from serverfault.com Aug 9 '13 at 14:30

This question came from our site for professional system and network administrators.

add comment

1 Answer 1

I would add the -L option to screen which turns on your screen log (which defaults to the file name screenlog.0). You then may be able to see what is happening. I would imagine screen is seeing the whole qlogin; cd path; mvn options program as a program to execute, (rather than a set of different commands) failing to execute that and then exiting.

Another alternative is to put the commands being executed into a script:

#!/bin/sh
qlogin
cd path
mvn options program

Create a screenrc file (say we call it mysessionrc):

# myscreenrc

#Create window 0 with title 'mvn' and run /path/to/myscript.sh
screen -t mvn 0 /path/to/myscript.sh

and then run ssh -t me@server 'screen -R session -c mysessionrc' instead. I've had to do this to get screen working on FreeBSD+ssh+screen combinations.

If that still fails, then I'd add:

zombie kr
verbose on

to the start of your mysessionrc file to make screen prompt about what to do with the running command after it completes k kill or r restart, and verbose will output some info about what screen is getting up to.

share|improve this answer
    
Thanks but this didn't help me. I can ssh over and start a screen but it doesn't seem like any of the other commands are working and I just get stuck sitting in the new screen –  akobre01 Aug 19 '13 at 22:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.