Graphical applications will not start as root user

Issues related to applications and software problems and general support
Post Reply
cknowlto
Posts: 7
Joined: 2017/12/14 16:57:17

Graphical applications will not start as root user

Post by cknowlto » 2019/10/30 13:03:21

Trying to install ClearCase as root. The rational installation manager is a GUI Java application which comes pre-bundled with its own jre.

Running this program as a non-root user succeeds, which then gives you the "You need to be administrator" prompt, then exits.
Running the program as the root user does NOT succeed.

[root@cfk-CentOS8-vm1 1.8]# ./install
No protocol specified
No protocol specified
00:00.33 ERROR [main] org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory safeLogged
Application error
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(SWT.java:4394)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:914)
at org.eclipse.swt.widgets.Display.create(Display.java:900)
at org.eclipse.swt.graphics.Device.<init>(Device.java:156)
...
No protocol specified
Install:
An error has occurred. See the log file
/tmp/1.8/configuration/1572378099068.log.


Contents of the referenced log:

[root@cfk-CentOS8-vm1 1.8]# more /tmp/1.8/configuration/1572378099068.log
!SESSION 2019-10-29 15:41:38.891 -----------------------------------------------
eclipse.buildId=unknown
java.fullversion=JRE 1.7.0 IBM J9 2.6 Linux amd64-64 Compressed References 20150
701_255667 (JIT enabled, AOT enabled)
J9VM - R26_Java726_SR9_20150701_0050_B255667
JIT - tr.r11_20150626_95120.01
GC - R26_Java726_SR9_20150701_0050_B255667_CMPRSS
J9CL - 20150701_255667
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -toolId install -accessRights admin input @osgi.install.ar
ea/install.xml
Command-line arguments: -os linux -ws gtk -arch x86_64 -toolId install -accessR
ights admin input @osgi.install.area/install.xml

!ENTRY org.eclipse.osgi 4 0 2019-10-29 15:41:39.815
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(SWT.java:4394)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:914)
at org.eclipse.swt.widgets.Display.create(Display.java:900)
at org.eclipse.swt.graphics.Device.<init>(Device.java:156)
at org.eclipse.swt.widgets.Display.<init>(Display.java:498)
at org.eclipse.swt.widgets.Display.<init>(Display.java:489)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:680)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at com.ibm.cic.agent.internal.ui.AgentUIApplication.initDisplay(AgentUIA
pplication.java:164)
at com.ibm.cic.agent.internal.ui.AgentUIApplication.launch(AgentUIApplic
ation.java:200)
at com.ibm.cic.agent.internal.ui.AgentUIApplication.start(AgentUIApplica
tion.java:87)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl
e.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
cation(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
lipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


I checked and gtk2 is installed and up-to-date.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Graphical applications will not start as root user

Post by TrevorH » 2019/10/30 13:09:20

That appears to want a graphical display running in order to work. That will not work if you have a GUI and are logged on as a normal user and then su - to root. That will unset all the environment variables that tell it about the display and in any case, it checks what user is trying to display on "my" display and refuses to let anyone else do so unless they're authorized.

Is there no text mode install?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

cknowlto
Posts: 7
Joined: 2017/12/14 16:57:17

Re: Graphical applications will not start as root user

Post by cknowlto » 2019/10/30 13:20:27

This install worked in every other CentOS and RHEL release since the beginning of time. With the GUI. In addition, I have had it work on another CentOS 8 install. However, since I do not understand the error message being presented here, I do not know what differences to look for.

It is obvious that the java application is failing to open a display, the problem is that "No Protocol Specified" is completely useless for determining what actually failed. Even knowing what binary reports this error message would be a clue.

In the case where I had to run the install over the network (not the case here) I would make the root user use the .Xauthority file for a valid user on that system and it would STILL work, even over the network.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Graphical applications will not start as root user

Post by TrevorH » 2019/10/30 13:23:37

What does echo $DISPLAY at that root command prompt say?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

cknowlto
Posts: 7
Joined: 2017/12/14 16:57:17

Re: Graphical applications will not start as root user

Post by cknowlto » 2019/10/30 13:29:05

:0

More clues.

There is no .Xauthority file for the root user.
stack trace of the launch of the install tool shows a lot of this kind of error:

openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/messages.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/messages.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/messages.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/messages.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/messages.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/messages.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
futex(0x7fbb85f98f78, FUTEX_WAKE_PRIVATE, 2147483647) = 0
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/gtk20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/gtk20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/gtk20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/gtk20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/gtk20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/gtk20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)

cknowlto
Posts: 7
Joined: 2017/12/14 16:57:17

Re: Graphical applications will not start as root user

Post by cknowlto » 2019/10/30 13:30:35

uname({sysname="Linux", nodename="cfk-CentOS8-vm1", ...}) = 0
access("/root/.Xauthority", R_OK) = -1 ENOENT (No such file or directory)
brk(NULL) = 0x1087000
brk(0x10aa000) = 0x10aa000
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{iov_base="l\0\v\0\0\0\0\0\0\0\0\0", iov_len=12}, {iov_base="", iov_len=0}], 2) = 12
recvfrom(3, "\0\26\v\0\0\0\6\0", 8, 0, NULL, NULL) = 8
recvfrom(3, "No protocol specified\n\0\0", 24, 0, NULL, NULL) = 24
write(2, "No protocol specified\n", 22No protocol specified
) = 22
shutdown(3, SHUT_RDWR) = 0
close(3) = 0
brk(NULL) = 0x10aa000
brk(NULL) = 0x10aa000
brk(0x10a5000) = 0x10a5000
brk(NULL) = 0x10a5000
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...})

cknowlto
Posts: 7
Joined: 2017/12/14 16:57:17

Re: Graphical applications will not start as root user

Post by cknowlto » 2019/10/30 13:43:32

I think I now have a clue. But I obviously ran the xauth command improperly.
Any ideas on how to do this properly?

[root@cfk-CentOS8-vm1 ~]# rm .Xauthority
rm: remove regular file '.Xauthority'? y
[root@cfk-CentOS8-vm1 ~]# touch !$
touch .Xauthority
[root@cfk-CentOS8-vm1 ~]# xauth add ${HOST}:0 . $(xxd -l 16 -p /dev/urandom)
[root@cfk-CentOS8-vm1 ~]# echo $DISPLAY
:0
[root@cfk-CentOS8-vm1 ~]# cd /tmp/1.8
[root@cfk-CentOS8-vm1 1.8]# ./install
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key00:00.33 ERROR [main] org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory safeLogged
Application error
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(SWT.java:4394)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:914)
at org.eclipse.swt.widgets.Display.create(Display.java:900)
at org.eclipse.swt.graphics.Device.<init>(Device.java:156)
...
Invalid MIT-MAGIC-COOKIE-1 keyInstall:
An error has occurred. See the log file
/tmp/1.8/configuration/1572442756511.log.

Post Reply