Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I connected to a linux server with PuTTY and start a screen session, and start matlab with:

matlab -nodesktop

Then, I run my matlab code as usual. The code will run for hours. So to test whether screen works, I start another PuTTY session and run top. Then, I close PuTTY session with still-running Matlab (top shows Matlab at 100% CPU usage) in screen. To my surprise, my Matlab process vanished after I close the aforementioned session. I've tried this a few times, and it seems the same thing happened.

screen -ls

shows that my screens are there but detached. top also shows that my matlab is not there.

What might be the possible cause of this? Doesn't screen normally should keep on running even I terminate my PuTTY session?

share|improve this question
What do you see when you resume the screen session? Does Matlab give any errors? – user130039 Nov 18 '12 at 16:37
When I resume the session, I see that I got back to bash, not Matlab. Moreover, bash does not show my input anymore, just like when I am typing password while logging in. But I can still execute command around. – Karl Nov 19 '12 at 5:38
up vote 1 down vote accepted

If Matlab on linux, although ran with '-nodesktop' option, is connected to XMing via PuTTY, then when PuTTY session is terminated, the communication between matlab and XMing will be lost and Matlab will stop working.

Therefore, in this case, use '-nodisplay', NOT '-nodesktop'.

share|improve this answer
Great! Worked like a treat - would this still work with '-nodisplay -nodesktop' (i.e. both flags)? – David_G Dec 2 '13 at 17:46

Because if you terminate putty session, you basically terminate all running in this session does't matter if it is desktop or shell. It is the same as you log out of the system. This may help you.

share|improve this answer
Nope, I used screen, so normally, screen should still be running, even after I disconnected, no? – Karl Nov 18 '12 at 19:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .