Run IDL over remote server without interrupting process in case of disconnect?

441 views
Skip to first unread message

steppenwolf

unread,
Jan 28, 2020, 7:20:28 PM1/28/20
to idl-pvwave
I run IDL by ssh over a remote Unix server, and sometimes a long-running IDL process gets interrupted in the event that I loose my connection to the server. Is there any way to avoid this? Is it possible to run an IDL script from a bash terminal, without staring the IDL command line interpreter? In that case, a "nohup" command could be used to prevent a process from getting killed if the server disconnects.

Kyle Wodzicki

unread,
Jan 28, 2020, 9:20:31 PM1/28/20
to idl-pvwave
Lately I have been using tmux when working remotely. It allows you to have multiple bash instances running over one ssh connection, splitting the window into panes. You can disconnect from a tmux session with it still running in the background.

You could also use a screen, which can be attached/detached so that you are able to run sessions in the background, but still be able to re-attach and interact with them.

The last method, which uses nohup, is to use the -e flag. The -e flag takes a string argument that contains the IDL command(s) to run. E.g.

idl -e "PLOT, INDGEN(10) & WAIT, 10"

should spool up and IDL session, plot a line, then sleep 10 seconds before closing.

I have attached a small bash script I made a long time ago. The script has 1 required input, the -e part of the idl command, and an optional second input for naming a logging directory. All output from the IDL command(s) run is saved to $HOME/logs/YYYY-MM-DD_hh_mm/outfile.log; if the optional input argument is used, the log directory changes to $HOME/logs/$2-YYYY-MM-DD_hh_mm. A save_pid.txt file is also saved that contains the PID of the IDL process.

Hope this helps.

idl_back

steppenwolf

unread,
Jan 28, 2020, 10:24:26 PM1/28/20
to idl-pvwave
Thanks, these seem very useful! I may return with more questions, but could you link some documentation for the "-e" flag? Is this an IDL feature?

Markus Schmassmann

unread,
Jan 29, 2020, 6:09:41 AM1/29/20
to idl-pvwave
Command-line Options for IDL Startup documents also the '-e' flag. If all you want to do is run non-interactive scripts, this is sufficient.

I normally use  screen for remote interactive sessions,  but as the IDL licence server requires an unchanged SCREEN environment variable and it is sometimes necessary to change SCREEN to reconnect the x-server after reattaching the  screen  session, this does not work if you require an output to your display.  Or does anybody know a way around that?

Does reattaching a session with  tmux  allow working with IDL graphics?

Or is there another way to reattach a remote interactive IDL session and retain full graphics functionality (short of using a remote desktop like with TigerVNC)?



Lajos Foldy

unread,
Jan 29, 2020, 7:14:01 AM1/29/20
to idl-pvwave
I usually start 'vncserver -geometry 1280x1024 :1' on a remote opensuse tumbleweed machine, then (still on the remote machine) 'vncviewer :1'.

steppenwolf

unread,
Jan 31, 2020, 11:43:40 AM1/31/20
to idl-pvwave
Thanks for the replies everybody! Very useful :)
Reply all
Reply to author
Forward
0 new messages