Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a rather complex problem, I'll try to keep it short and sweet:
I ssh (Cygwin on Windows XP) to a Linux machine at a university 150 miles away. On this Linux machine I run a program called Fluent (computational fluid dynamics software).
Fluent has a text user interface which generally permits me to write a journal file of commands and execute them in batch mode, without GUI, with the following commands:
$ at -f <batch_file.txt> now
where <batch_file.txt> contains the fluent command:
where -g is a switch that supresses GUI and graphics, <journal_file.txt> is the list of Fluent commands, and text_output.out is the file that contains the redirected text output of Fluent.
Fluent has a bug, though (at least one). There is one command that I *must* run in Fluent that cannot be executed through the TUI. I can enter GUI commands in the journal file, but I clearly cannot run Fluent in batch mode if I do this. Fluent support is working the bug, but I don't think we'll see a fix from them until the next release, if then.
I must run Fluent in batch mode, as my calculations require days and weeks to execute (my connection would never survive long enough).
What I am dreaming of is a way to run Fluent without suppressing graphics, so as to permit the running of GUI commands in the journal file. However, I would want to redirect this GUI in such a manner that I can still run in batch mode.
I heard somewhere that people have used 'setenv DISPLAY /dev/null' to suppress graphics output, but that won't help me as it would muck up my ssh.
Any ideas? If you need any more info, let me know. I know just enough about Linux to be dangerous, so use small words when you are trying to describe things to me.
I'm afraid that won't work as the DISPLAY variable is set (and required) by ssh to be localhost. It would work if I were actually sitting at the machine.
As such, the logical conclusion seems to be to use VNC, which I learned about the other day. I can tunnel VNC through ssh, spawn a desktop, do whatever I want graphically on the machine, and close VNC. The desktop will still run even though I am not logged in. I have yet to restart my calculation as the network admins decided it was prudent to delete all of my files off of my home directory!
I think the bash script runs in it's own shell, so the enviroment variable is known in that shell. like in X: if I open a xterm and set a enviroment variable it isn't set in another xterm. and this bash script is called by at, so at spawns a bash shell with the DISPLAY variable set, without ssh, right?
Even so, ssh doesn't require DISPLAY to be set to localhost. However, if you want graphics to be displayed (which you say you don't), then DISPLAY should point to a display accepting connections for you.
This may be localhost (which is provided by ssh), but it might as well be something else, including (possibly) /dev/null.
I too never heard of this trick though. I'm going to try it as soon as I get home
Did anyone ever figure this out? I have basically the same problem, I need to run a program in the background while I'm disconnected, but it needs a window open...
I can be way off here, but have you guys tried to "&" in the end of the command? When I'm at work, I ssh into my home linux and do "wget http://etc etc ... &" to send the download to background. Even after logging ssh off the download continues.
No because the program requires an Xwindow to stay open to run. Doing mozilla& will still open mozilla on my local machine. I need the window to be opened on the machine I'm logged into and stay open.
I tried setting the display to /dev/null, but that doesn't work for all applications (at least xload wouldn't accept it - not that that would have made any sense, but still)
So I guess I recommend using vnc for these cases. It gives you a normal x-display with the ability to disconnect and reconnect without shutting down any programs in between.
If you don't need to actually see the X window, then you might look at using xvfb to set up a virtual X framebuffer. xvfb acts just like a normal X server, except that it doesn't use any display or input hardware (and so doesn't generate input events); the framebuffer itself is held in virtual memory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.