Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to run DiabloMiner, and keep it running after I logout. I try to use screen.

So what I do is:

  1. login to the host, with -X switch. Like: ssh -X myhost
  2. run screen
  3. run my script, i.e. ./DiabloMiner-Linux.sh -u my_user -p my_password -dd > log.txt
  4. detach from screen by Ctrl+A, then D
  5. try to logout, by Ctrl+D

Then my logout hangs. All I can do is Ctrl+C, but then when I login again, I can see by ps that DiabloMiner died.

How to run it to survive logout from myhost?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I'm assuming DiabloMiner has a GUI which is why you've opted to use the -X option. Screen creates a virtual psuedo-terminal with disconnect and background functionality. However, the -X option tells ssh to tunnel any X11 traffic back to the host you are on. This isn't what you want as when you close the ssh session, you break the X11 traffic causing DiabloMiner to die.

The only way you can keep a GUI application (unless it has a headless mode, which would eliminate the need for -X altogether) running on a remote host is to start a remote X server for running the application. You may want to look into vncserver and vncviewer for this purpose.

share|improve this answer
    
No, DiabloMiner doesn't have a GUI, but it uses GPU. It makes a lot of computing on a GPU. I'm pretty sure it does it on host machine, because my graphics card on my laptop (which I am ssh'ing from) is not compatibile with it. However, -X is necessary for some reason. Without it DiabloMiner throws an exception. –  amorfis Jun 13 '11 at 21:37
    
Maybe I should set DISPLAY so it could connect to host X windows, but what should it be set to? –  amorfis Jun 13 '11 at 21:40
    
Perhaps there is no GUI but X11 calls are required? In this case the above suggestion of using vnc server still applies. You should be able to run the program inside a vnc server session and disconnect from it. –  Kyle Smith Jun 13 '11 at 22:06

I think you need to research nohup . It works good when using a console program, like a Java console program. For an X-window program, things might be different, but I think nohup is the general thing you are looking for.

Also, gnu screen might help you as well since it has some nohup features.

share|improve this answer
1  
I already tried screen, and it didn't work. nohup didn't work too. –  amorfis Jun 14 '11 at 7:17

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.