-1

I am using SSH to access to Openshift VM, i'm running a simple java program (java -jar ....) that takes a while a to complete, and do some heavy work. But the execution always gets terminated, along with the SSH session. Using putty, i get a

Server unexpectedly closed network connection

I have tried to set the TMOUT variable to a higher value, and enabled the TCP keepalives from putty. It works when idle, but when i run the java program it get excluded once again after like 5min.

So are there any restriction or limits set by openshift? any other configuration i can do to fix this? and how can i can the last exiting error in java or the ssh session?

EDIT: I alos tried lunching it with: nohup java -jar name.jar &

and it also died after several minutes (i checked using ftp logs)

  • What Do The Logs Say? – Jenny D Jul 16 '16 at 17:37
  • @JennyD if ur talking about the ftp logs, im just looking at the last modified date of the nohup.out file, other than that, i dont know which logs i should be looking at – Ouerghi Yassine Jul 16 '16 at 17:45
  • Maybe it's getting killed because the machines runs out of memory...? – gxx Jul 16 '16 at 18:18
  • Whyever would ftp logs be relevant to a process dying and an SSH session getting closed down? You need to check the server's system logs. – Jenny D Jul 16 '16 at 19:53
  • @JennyD cuz when i use nohup, the process continue working even if the ssh session is terminated? and im using openshift, its a shared environment, i dont know where i can find the logs, or if i have access to them. – Ouerghi Yassine Jul 16 '16 at 20:23
  • @JennyD would you mind telling me why you marked the question as off-topic? – Ouerghi Yassine Jul 17 '16 at 13:43
  • @OuerghiYassine For the reason stated in the close message. What part of it is unclear? – Jenny D Jul 18 '16 at 11:29
  • The part where it said "off-topic", according to [serverfault help](http://serverfault.com/help/on-topic), is stated: `tools used for administering, monitoring, or automating these`, which i think what my question is about, also `deployment to and management of third-party provided information technology platforms`, what openshift is. – Ouerghi Yassine Jul 18 '16 at 23:29

1 Answers1

3

You should not be relying on keeping an SSH connection active for successful execution of a long-running process. Instead of doing is as you are, start up a tmux or GNU screen session first and run your process within that. This way, the process will continue running if your SSH connection dies.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • ...and if the connection dies because reasons, there might be remnants in the screen/tmux session that tell you what happened. – user Jul 16 '16 at 16:43
  • yes, sorry forgot to mention i even tried "nohup java -jar name.jar &" it died after some mins (checked through ftp logs) – Ouerghi Yassine Jul 16 '16 at 16:50