Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » TheIDE runs differently under root
TheIDE runs differently under root [message #38475] Wed, 19 December 2012 21:18 Go to next message
CppMod is currently offline  CppMod
Messages: 11
Registered: February 2011
Location: Plano, TX
Promising Member
I have a program that must run as root because of some low level I/O (embedded system). I can build the program at user level, but then I have to go to a root terminal to run it.

I can start TheIDE in a root terminal ok, but the pane on the far left is missing, and I have not figured out how to add a file without

1) going back to a user terminal,
2) running TheIDE there,
3) right-click to add the file(s),
4) going back to the root terminal,
5) running TheIDE,
6) selecting File|Open File Directory, and
7) dragging and dropping the new file(s) onto TheIDE.

I tried running TheIDE in my user terminal using sudo, and the result was "No protocol specified (<unknown>:2801): Gtk-WARNING **: cannot open display:0.0

su - gave the same error.

I dimly recall that there is a way to set up the display, but I don't remember how.

But the basic question is, "Why does TheIDE run differently as root?" Followed by, "What do I need to do to fix this?"

P.S. Right-clicking "File" on the menu does nothing, either as root or as user.


611bb927f8731cdc83c3f1eb09e758ac
Re: TheIDE runs differently under root [message #38477 is a reply to message #38475] Wed, 19 December 2012 22:28 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi CppMod,

I am currently doing some playing around with a gumstix and I first ran TheIde on the target itself.
The default user (and only available) is root and everything works fine.

You probably know everything I'm about to say, but just in case.

To export the screen on my PC I run ssh from my PC to connect to the gumstix:
PC:
ssh -XY myGumstix

in ssh shell :
export DISPLAY=:0
... do whatever you need,
the apps will pop up on you're PC

This sound's like what you are trying to do

[Updated on: Wed, 19 December 2012 22:29]

Report message to a moderator

Re: TheIDE runs differently under root [message #38479 is a reply to message #38475] Wed, 19 December 2012 23:13 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi CppMod,

Can you tell us what OS and desktop environment do you use? I have no problem running TheIDE as root, but the problems you report seems more like a fault in the communication with X or DE. Please check that File menu is not opening underneath theide (you can test by resizing it to small enough window so that the menu is long enough to stick out on the bottom). There have been troubles like this in past.

Also, you can run TheIDE as normal user and create a macro to execute the program as root. Some examples and docs can be found in the Macro page in manual and some helpful tricks might also be in the article about cross compiling.

Best regards,
Honza

[Updated on: Thu, 20 December 2012 06:54]

Report message to a moderator

Re: TheIDE runs differently under root [message #38484 is a reply to message #38475] Thu, 20 December 2012 08:06 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,

there is a script auto-executed when a terminal open, its name is ".${SHALL}rc"
if your shall is bash (the default) then the file is ".bashrc"
compare the one in your Home directory with the one in the root directory, i think the source of problem is here.

Regards
omari.


regards
omari.
Re: TheIDE runs differently under root [message #38503 is a reply to message #38479] Thu, 20 December 2012 23:04 Go to previous messageGo to next message
CppMod is currently offline  CppMod
Messages: 11
Registered: February 2011
Location: Plano, TX
Promising Member
dolik.rce wrote on Wed, 19 December 2012 16:13

Hi CppMod,

Can you tell us what OS and desktop environment do you use? I have no problem running TheIDE as root, but the problems you report seems more like a fault in the communication with X or DE. Please check that File menu is not opening underneath theide (you can test by resizing it to small enough window so that the menu is long enough to stick out on the bottom). There have been troubles like this in past.
I am doing development directly on the target system, which is an Advantech PCM9389 SBC. Intel x86 with an installation of Debian 6.

dolik.rce wrote on Wed, 19 December 2012 16:13

Also, you can run TheIDE as normal user and create a macro to execute the program as root. Some examples and docs can be found in the Macro page in manual and some helpful tricks might also be in the article about cross compiling.

Best regards,
Honza
That looks like a better workaround than I'm currently using.


611bb927f8731cdc83c3f1eb09e758ac
Re: TheIDE runs differently under root [message #38504 is a reply to message #38484] Thu, 20 December 2012 23:12 Go to previous messageGo to next message
CppMod is currently offline  CppMod
Messages: 11
Registered: February 2011
Location: Plano, TX
Promising Member
omari wrote on Thu, 20 December 2012 01:06

Hi,

there is a script auto-executed when a terminal open, its name is ".${SHALL}rc"
if your shall is bash (the default) then the file is ".bashrc"
compare the one in your Home directory with the one in the root directory, i think the source of problem is here.

Regards
omari.
That sounds about right. I've been away from *nix long enough that I've forgotten a lot of those sorts of details, and all of the help/man files assume you know and remember that sort of thing.

I actually have several years of Linux/Unix experience, but very little of it involved anything to do with administering the system. Now that I'm the admin, I can't just go running to the admin for setup tasks Smile

There are several other things I need to learn as I get my *nix finger-habits back, that would probably be major time-savers.

I think I have enough information to fix this problem. I'll be back, probably tomorrow morning, to mark this SOLVED. I hope.

Thanks!


611bb927f8731cdc83c3f1eb09e758ac
Re: TheIDE runs differently under root [message #38505 is a reply to message #38477] Thu, 20 December 2012 23:15 Go to previous messageGo to next message
CppMod is currently offline  CppMod
Messages: 11
Registered: February 2011
Location: Plano, TX
Promising Member
Didier wrote on Wed, 19 December 2012 15:28

Hi CppMod,

I am currently doing some playing around with a gumstix and I first ran TheIde on the target itself.
The default user (and only available) is root and everything works fine.

You probably know everything I'm about to say, but just in case.

To export the screen on my PC I run ssh from my PC to connect to the gumstix:
PC:
ssh -XY myGumstix

in ssh shell :
export DISPLAY=:0
... do whatever you need,
the apps will pop up on you're PC

This sound's like what you are trying to do
Not quite. I'm doing development work directly on the target system. The export DISPLAY=:0 didn't do anything on the user terminal.


611bb927f8731cdc83c3f1eb09e758ac
Re: TheIDE runs differently under root [message #38506 is a reply to message #38505] Thu, 20 December 2012 23:24 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Quote:

The export DISPLAY=:0 didn't do anything on the user terminal.


Sorry I mixed up my explanations:

To export display to your computer:
ssh -YC myGumstix

To display on the lcd of my gumstix
ssh myGumstix ( no -YC )
in ssh console : export DISPLAY=:0


If I don't
export DISPLAY=:0
in the gumstix console
I get the same errors as you when launching my app.

[Updated on: Thu, 20 December 2012 23:24]

Report message to a moderator

Re: TheIDE runs differently under root [message #38507 is a reply to message #38484] Thu, 20 December 2012 23:35 Go to previous messageGo to next message
CppMod is currently offline  CppMod
Messages: 11
Registered: February 2011
Location: Plano, TX
Promising Member
omari wrote on Thu, 20 December 2012 01:06

Hi,

there is a script auto-executed when a terminal open, its name is ".${SHALL}rc"
if your shall is bash (the default) then the file is ".bashrc"
compare the one in your Home directory with the one in the root directory, i think the source of problem is here.

Regards
omari.
I had hopes for this, but when I tried doing a "source ./.bashrc" in the root terminal in my own home directly, I still had a missing panel on the left in TheIDE. Where is the configuration file for TheIDE kept? That may be the problem.


611bb927f8731cdc83c3f1eb09e758ac
Re: TheIDE runs differently under root [message #38511 is a reply to message #38507] Fri, 21 December 2012 09:38 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,

in the root terminal, try this:

source /home/[user]/.bashrc


(replace [user] by your user name)

Regards
omari


regards
omari.
Re: TheIDE runs differently under root [message #38522 is a reply to message #38511] Fri, 21 December 2012 16:03 Go to previous messageGo to next message
CppMod is currently offline  CppMod
Messages: 11
Registered: February 2011
Location: Plano, TX
Promising Member
omari wrote on Fri, 21 December 2012 02:38

Hi,

in the root terminal, try this:

source /home/[user]/.bashrc


(replace [user] by your user name)

Regards
omari
I tried that. No difference in TheIDE's behavior. Just to be 100% I was getting the right .bashrc, I changed my home .bashrc to colorize the prompt. I think that TheIDE is getting some initialization from a different place if it's running under root.


611bb927f8731cdc83c3f1eb09e758ac
Re: TheIDE runs differently under root [message #38529 is a reply to message #38506] Fri, 21 December 2012 17:34 Go to previous messageGo to next message
CppMod is currently offline  CppMod
Messages: 11
Registered: February 2011
Location: Plano, TX
Promising Member
Didier wrote on Thu, 20 December 2012 16:24

Quote:

The export DISPLAY=:0 didn't do anything on the user terminal.


Sorry I mixed up my explanations:

To export display to your computer:
ssh -YC myGumstix

To display on the lcd of my gumstix
ssh myGumstix ( no -YC )
in ssh console : export DISPLAY=:0


If I don't
export DISPLAY=:0
in the gumstix console
I get the same errors as you when launching my app.

Does this apply if I'm doing the development work directly on the target system?


611bb927f8731cdc83c3f1eb09e758ac
Re: TheIDE runs differently under root [message #38530 is a reply to message #38529] Fri, 21 December 2012 18:18 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Quote:

Does this apply if I'm doing the development work directly on the target system?


YES,

I did exactly the same thing before setting up the cross compile environment
Re: TheIDE runs differently under root [message #38531 is a reply to message #38522] Fri, 21 December 2012 19:32 Go to previous message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
CppMod wrote on Fri, 21 December 2012 10:03

I think that TheIDE is getting some initialization from a different place if it's running under root.



Try to run TheIDE with strace. You will be able to see all files it opens up. Filter them out and you will be able to see where it gets its configuration.

Just my 2 cents.


Regards,
Novo
Previous Topic: Bug: TheIde crashes when opening a project
Next Topic: Code completion stopped working
Goto Forum:
  


Current Time: Fri Mar 29 00:39:05 CET 2024

Total time taken to generate the page: 0.01218 seconds