Running ROOT without terminal

Hi,

I encountered a problem when trying to run ROOT-based application without terminal. This can be illustrated on simple example: let’s say there is a macro browser.C which creates TBrowser window. I try to run:

nohup root -l browser.C

It causes TBrowser window to appear for a second and then it disappears. I also tried with some input/output and it makes no difference.

Ulitmatelly, what I need is to add execution of this application to bash_profile, so it automatically starts when machine is rebooted. In this case I don’t use nohup, but there is still no terminal attached to this process and it doesn’t work as well on SLC6 (for some reason with nohup it works on Mac OS).

The question is: how do I run ROOT without a terminal.

Hi,

root -b.

Cheers,
Danilo

Hi,

thanks for the answer. The problem is that I need to display some graphical content, and -b switch will not allow me to do that.

Jeremi

Hi,

I misunderstood your previous mail: I thought about a graphics connection.
You could use screen:

screen -A -m -d -S MyROOTApp root appStartingATBrowser.C  &

Try a simple “main.cxx”: [code]#include “TApplication.h”
#include “TCanvas.h”
#include “TBrowser.h”

int main(int argc, char **argv) {
TApplication a(“a”, &argc, argv);

new TCanvas(); // “main menu” -> “File” -> "Quit ROOT"
new TBrowser(); // “main menu” -> “Browser” -> “Quit Root”

a.Run(kTRUE);
return 0;
}[/code] and then: `root-config --cxx --cflags` -o main main.cxx `root-config --libs` nohup ./main

I am not sure if it helps or not, but the case I have to deal with is the Event Display of ALICE, so alieve from AliROOT. Previously it looked like there is no difference between running alieve and root. Now, after trying your examples I can see different behavior. In both cases (screen and main.cxx) it works for ROOT, but not for alieve. Concerning second example, in alieve instead of TApplication we create TRint, maybe it makes it different.