OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Qt/Embedded data directory is not owned by user 0
cwalstad
post Jul 21 2004, 12:01 PM
Post #1





Group: Members
Posts: 9
Joined: 25-June 04
Member No.: 3,830



Hi,

I have a program that opens a raw socket. When I run this as non-root it begins and runs for a while until it comes to the code where it opens a raw socket and prints "socket: Operation not permitted". This is all as I expected. So when I su to root and run the same program with the exact same command I get the error message "Qt/Embedded data directory is not owned by user 0". I really don't know what this means but I found one source that said this is a bug in Qt and the way to solve it is to delete the qtembedded-zaurus directory in tmp. I did this. Now when I run the exact same command I get the error "QSocket::writeBlock: Socket is not open" printed 4 times and then "No Qt/Embedded server appears to be running. If you want to run this program as a server add the '-qws' command-line option. I tried adding the command line option as instructed but this didn't work.

So I also did another test to see if deleting the directory created a problem. Now when I type evm --help (my program is mostly in java and calls some c code for the raw socket) I get the "QSocket::writeBlock: Socket is not open" error message again.

I really have no idea what is going on. If anyone can offer a fix to my problem or some workaround I would be very happy. Thanks for your help.

Chris
Go to the top of the page
 
+Quote Post
tumnus
post Jul 21 2004, 01:35 PM
Post #2





Group: Members
Posts: 1,176
Joined: 3-October 03
From: UK
Member No.: 547



QT needs that stuff in /tmp, terminate Qtopia and let it restart to sort that lot out.

The reason why you cannot run QT apps as root is because all the QT stuff is running as the 'zaurus' user. It's a bit like Xauth in X Windows. Even root cannot normally run an X app under some other user's session unless they give permission. However I have not seen a way of giving permission in QT/E.

The only workaround I have found is that you can run QT apps as the zaurus user with sudo to get root priviledges.
Go to the top of the page
 
+Quote Post
cwalstad
post Jul 22 2004, 07:05 AM
Post #3





Group: Members
Posts: 9
Joined: 25-June 04
Member No.: 3,830



I tried using sudo, but the problem with that is it disables the LD_LIBRARY_PATH environmental variable, which I need to have (and set) so that my program can locate a shared library.

"sudo tries to be safe when executing external commands. Variables that control how dynamic loading and binding is done can be used to subvert the program that sudo runs. To combat this the LD_, _RLD_, SHLIB_PATH (HP-UX only), and LIBPATH (AIX only) environment variables are removed from the environment passed on to all commands executed" - from the Sudo website

Apparently the Zaurus searches for shared libraries in /usr/QtPalmtop.rom/ , so I tried to just copy my library into there but it won't let me (even when I am root) because
CODE
cp: unable to open '/usr/QtPalmtop.rom/libLogger.so': Read-only file system



Thanks for your help
Go to the top of the page
 
+Quote Post
tumnus
post Jul 22 2004, 12:31 PM
Post #4





Group: Members
Posts: 1,176
Joined: 3-October 03
From: UK
Member No.: 547



By default the Zaurus is setup to search in /usr/lib and AFAICR LD_LIBRARY_PATH isn't normally setup anyway. Have you tried /usr/lib?

Which Zaurus do you have? With the 5600 or later, you can make the ROM area writable. With the Sharp ROM's at least there is a little bit of free space, so as long as your library can fit in there you can put your library in /usr/QtPalmtop.rom/lib . Look at the 4th post here.
Go to the top of the page
 
+Quote Post
cwalstad
post Jul 22 2004, 01:58 PM
Post #5





Group: Members
Posts: 9
Joined: 25-June 04
Member No.: 3,830



Thanks. Putting the library in the usr/lib/ directory worked. I still don't understand why the Zaurus has these problems though. On an unmodified zaurus I tried running evm --help and this prints the standard help message for a java virtual machine. Then I switched to super user and ran the same command but got the data directory does not belong to user 0 error again. I think this is a big problem with the Zaurus. Is there any permanent way to change this behavior that does not involve using sudo every time I want to do something as root?
Go to the top of the page
 
+Quote Post
lpotter
post Jul 22 2004, 03:40 PM
Post #6





Group: Members
Posts: 451
Joined: 27-November 03
From: Brisbane, Australia
Member No.: 1,001



as root, when you are not running qtopia, remove the /tmp/qtembedded- directory
rm -rf /tmp/qtembedded*
and maybe also
rm -rf /tmp/qcop*
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st November 2014 - 02:38 AM