How to stop a program from passing away when its ssh session passes away?

I have an actually old console application that I intend to make a little bit extra resistant. The program is utilized in this manner :

  • the customer makes use of a personalized terminal emulator to connect to a remote equipment via ssh
  • the customer begins a covering manuscript
  • the covering manuscript could start a lengthy - running progression data source procedure.

Clearly, occasionally customers merely shed the ssh link to the equipment, and also in this instance, the ssh session is ended, the covering manuscript running within is ended, and also ultimately the progression data source procedure is ended too. In like one instance out of a thousand this creates corruption in the data source, so I would certainly such as to stop it from taking place.

What I attempted until now :

  • beginning a screen or tmux session prior to beginning the covering manuscript - this does not function due to the fact that the application requires the TERM variable to be readied to at386 (and also it bypasses termcap/terminfo entirely ... ugh ...)
  • nohup/disown the progression procedure - this does not function due to the fact that the covering manuscript and also the progression procedure are continually interaction with each various other in rare means it appears

Any various other suggestion of just how to see to it that the progression procedure does not end when the ssh session is eliminated?

0
2019-12-02 03:09:44
Source Share
Answers: 4

Perhaps attempt a remote X desktop computer using vnc or nx. You can passage vnc over ssh for security or usage nx which runs using ssh by default (and also is much quicker). The application can after that run in a Terminal on the X desktop computer and also if the link is shed, the desktop computer would certainly maintain going permitting reconnection any time. My choice is No Machine NX which is free for approximately 2 synchronised customers and also mounts really conveniently.

A choice, if readily available, is to make use of a remote console using ALOM, ILOM, DRAC, IP - kvm or IP - serial console, and so on. In this way the application would certainly be working on the console and also can not be disturbed by a link failing.

0
2019-12-03 05:04:42
Source

Add term at386 to your.screenrc in order to bypass TERM. If this does not aid, attempt dtach as opposed to Screen (which does not do any kind of terminal emulation itself).

0
2019-12-03 05:04:35
Source

In various other words, you are seeking something like screen, yet that passes control series to the terminal as opposed to doing its very own translation? Attempt dtach. It gives the very same terminal detachment attribute as screen, yet without the numerous home windows or the terminal emulation.

0
2019-12-03 05:04:27
Source

In several instances, the most basic remedy is to make use of nohup and also placed the non - interactive process right into the history making use of & and also reroute typical result and also typical mistake to documents.

0
2019-12-03 02:46:35
Source