Do not log in as root if you don’t have to – Rule Studio on Linux may not show up


Running ILOG JRules’ Rule Studio on Linux (or any Unix-like operating system with X Window System) can cause some pain when X Window System is not properly set up for the account you work with. I don’t think it will come out as a hidden gem to most of you, but since it’s so obvious I was the one who forgot about it and lost almost half an hour for its solution.

It hit me yesterday when I log in as root and su – jacek to run Rule Studio. To do some exercises with JRules I logged in to my VMware image with Linux as root and I switched to the user (with su – jacek) to run Rule Studio. A couple of secs and nothing showed up. “Hmmm, strange”, I thought. I repeated the command a couple of times and every time I fired Rule Studio it didn’t show up. I was working with RS two days ago so it was impossible! It took me half an hour to figure out I’m on the jacek account that was not granted the privs to connect to X Window System server. Doh!

When I tried to sort it out I run Rule Studio shell script (./WebSphereILOGJRules702/studio/Rule\ Studio) with sh -x to trace what’s going on behind the scenes. It didn’t help much, but I noticed that the LAX_DEBUG shell variable was everywhere. It doesn’t need a geek to realize that it could be for some debugging purposes (so is -x option for sh) and so I turned it on as follows:

[jacek@localhost ~]$ LAX_DEBUG=1 ./WebSphereILOGJRules702/studio/Rule\ Studio

I couldn’t believe what a nice printout showed up.

It was then when I come across the solution – X Window System didn’t allow me to draw the GUI of Rule Studio. Quick test with xterm and…

[jacek@localhost ~]$ xterm
Xlib: connection to “:0.0” refused by server
Xlib: No protocol specified

xterm Xt error: Can’t open display: :0.0

I knew I messed up with the accounts and X Window System – I was not authorized to connect to X server. The solution was to grant access for any client with xhost + for the root account or log out and in again as jacek. I chose the first approach (although I can’t explain why – don’t think “simpler” would be a correct word).

[root@localhost ~]# xhost +
access control disabled, clients can connect from any host

With the X server allowing me to connect Rule Studio’s splash screen popped up in a blink of an eye and I could work with it without the hassle.

And the advice goes “Do not log in as root if you don’t have to” as your Rule Studio installation may not show up.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s