RTC scm command-line on linux throws an error if no DISPLAY variable is set and/or Xwindows is not available
Paul Callahan (20●1●3●6)
| asked Aug 12 '13, 9:35 p.m.
retagged Aug 13 '13, 7:29 p.m. by Te-Hsin Shih (285●4)
my version of the installed command-line is
$scm -v
If I try to run scm by itself, it tries to put up a GUI dialog box. It works ok if I have a valid DISPLAY variable set, but it throws an error and core-dumps if not. I'm trying to run this as part of a headless server script so this is a problem. I've tried the --non-interactive flag, no joy. Is there a flag to make scm run in a headless mode?
I'm using jre 1.6_34, on centos 6.2 64-bit.
The error is:
(Scm.binary:7099): GLib-GObject-WARNING **: invalid (NULL) pointer instance |
5 answers
I resolved this by removing X Windows and GTK from the system entirely. Since this is a build server, it wasn't really needed anyway.
The dialog was something akin to "workspace not found" or something. I'm using the jenkins RTC plugin which first tries to run a history, and if by return code the workspace doesn't exist, jenkins goes ahead and creates it.
Thanks
Comments If removing X Windows from the system is not a good solution for others, an alternative to try would be to disable SWT. A simple way of doing this is to add a "-ws" argument to the scm.ini file: -ws none -vm ../../client/eclipse/jdk/jre/bin --launcher.suppressErrors ... By setting the window system to "none", the swt fragment (org.eclipse.swt.gtk.linux.x86) would fail to resolve. Though I'm not sure how the jenkins plugin would react to this.
Paul Callahan
commented Aug 13 '13, 4:11 p.m.
Thanks. That was probably the switches I was looking for. |
Since scm cli is based on Eclipse, Eclipse still requires a running X server to function. Probably there are ways to make Eclipse run in true headless mode.
Comments
Paul Callahan
commented Aug 13 '13, 12:10 p.m.
the scm command works fine on a system of mine that has no X installed at all. |
My understanding is that the application would need to be designed so it could run in headless mode. If scm is not designed to run in headless mode, then not sure anything can be done. If you find a way to get it to work please post here, otherwise I think this is a candidate for a feature enhancement. To open an enhancement request, select the "My Stuff" link in the upper right hand corner of jazz.net, then select the work item tab and click on open a defect. A prompt to log in will appear, use your jazz credentials, then fill out the work item.
|
As mentioned, the scm command line is based on Eclipse.
However, Eclipse has supported running on linux without a display since 3.4, and it looks like you are running RTC 4.0.1 which is based on Eclipse 3.6.1. You can double check that your scm.ini file contains the line --launcher.suppressErrors , this causes the launcher to print errors to stderr instead of showing a dialog. The 4.0.1 scm client I looked at has this already. If you do set the DISPLAY, what is the content of the dialog box being shown? It would be helpful to know where the dialog is coming from. |
My current version is RTC 4. I am running scm on Linux machines with X11 installed. My scm.ini contains:
-vm ../../client/eclipse/jdk/jre/bin --launcher.suppressErrorsWhether DISPLAY is defined or not, I don't see an X11 dialog and scm runs OK. Now, when we were running RTC 3, I remember having X11-related error messages when Eclipse-based utilities were launched in a shell that had the DISPLAY and XAUTHORITY env vars. Unsetting these vars fixed the prob. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
What is the exact command you are running?
How did you install scm?
Do you know what version you installed? (The -ver does not seem to show the "real" version)