LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 11-16-2004, 10:28 AM   #1
mattfr
LQ Newbie
 
Registered: Nov 2004
Posts: 7

Rep: Reputation: 0
Question Redirect X windows / GUI to /dev/null?


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:

fluent 3ddp -g <journal_file.txt> text_output.out 2>&1&

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.

Thanks all,
Matt
 
Old 11-18-2004, 08:54 AM   #2
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
if the 'setenv DISPLAY /dev/null' really works (I never tried it...) you may put it in the batch file, like this:
Code:
#!/bin/bash
setenv DISPLAY /dev/null
fluent 3ddp -g <journal_file.txt> text_output.out 2>&1&
at least this is safe enough to try

greetz,
.-=~ iluvatar ~=-.
 
Old 11-18-2004, 09:07 AM   #3
mattfr
LQ Newbie
 
Registered: Nov 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Lightbulb

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!

Thanks for your post.
 
Old 11-18-2004, 09:11 AM   #4
iluvatar
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: debian
Posts: 403

Rep: Reputation: 30
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?

greetz,
.-=~ iluvatar ~=-.
 
Old 11-18-2004, 10:54 AM   #5
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
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

Groetjes,

Kees-Jan
 
Old 12-19-2004, 02:26 PM   #6
kdotsky
LQ Newbie
 
Registered: Dec 2004
Posts: 4

Rep: Reputation: 0
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...

Thanks
 
Old 12-19-2004, 02:40 PM   #7
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,513

Rep: Reputation: 46
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.
 
Old 12-19-2004, 02:44 PM   #8
kdotsky
LQ Newbie
 
Registered: Dec 2004
Posts: 4

Rep: Reputation: 0
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.
 
Old 12-20-2004, 09:15 AM   #9
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
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.

Groetjes,

Kees-Jan
 
Old 12-20-2004, 09:40 AM   #10
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What would happen if I where to cat /dev/mem > /dev/null Joey.Dale Linux - General 11 07-26-2009 12:46 PM
/dev/null sachitha Programming 5 08-07-2005 11:25 AM
Send X Windows / GUI to /dev/null? mattfr Linux - General 3 11-17-2004 07:40 AM
mv c:\WINDOWS /dev/null; mount /dev/hda treehead LinuxQuestions.org Member Intro 5 10-19-2004 08:53 AM
>/dev/null lackluster Linux - Networking 5 06-27-2002 09:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration