Author Topic: Qt/Embedded data directory is not owned by user 0  (Read 19288 times)

cwalstad

  • Newbie
  • *
  • Posts: 9
    • View Profile
Qt/Embedded data directory is not owned by user 0
« on: July 21, 2004, 04:01:47 pm »
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

tumnus

  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
    • http://www.cpinkney.org.uk
Qt/Embedded data directory is not owned by user 0
« Reply #1 on: July 21, 2004, 05:35:58 pm »
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.
# Search the Zaurus Howtos ## Search the Zaurus FAQs ## Find Z software at ELSI #
--------------------
UK SL5500 with Sharp ROM 3.13, SL5600 with Sharp ROM 1.32 - SuSE 9.0 Pro, Windows XP Home
Qualendar for Calendar and Todo
Socket Bluetooth CF Card (Rev F), Kingmax 512MB MMC Card, Palm Tungsten T Stylus,
Pretec CF->Smartmedia Adapter, Semsons Universal Battery Extender

cwalstad

  • Newbie
  • *
  • Posts: 9
    • View Profile
Qt/Embedded data directory is not owned by user 0
« Reply #2 on: July 22, 2004, 11:05:17 am »
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: [Select]
cp: unable to open '/usr/QtPalmtop.rom/libLogger.so': Read-only file system

Thanks for your help
« Last Edit: July 22, 2004, 11:06:00 am by cwalstad »

tumnus

  • Hero Member
  • *****
  • Posts: 1176
    • View Profile
    • http://www.cpinkney.org.uk
Qt/Embedded data directory is not owned by user 0
« Reply #3 on: July 22, 2004, 04:31:53 pm »
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.
# Search the Zaurus Howtos ## Search the Zaurus FAQs ## Find Z software at ELSI #
--------------------
UK SL5500 with Sharp ROM 3.13, SL5600 with Sharp ROM 1.32 - SuSE 9.0 Pro, Windows XP Home
Qualendar for Calendar and Todo
Socket Bluetooth CF Card (Rev F), Kingmax 512MB MMC Card, Palm Tungsten T Stylus,
Pretec CF->Smartmedia Adapter, Semsons Universal Battery Extender

cwalstad

  • Newbie
  • *
  • Posts: 9
    • View Profile
Qt/Embedded data directory is not owned by user 0
« Reply #4 on: July 22, 2004, 05:58:11 pm »
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?

lpotter

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
    • http://qtopia.net
Qt/Embedded data directory is not owned by user 0
« Reply #5 on: July 22, 2004, 07:40:54 pm »
as root, when you are not running qtopia, remove the /tmp/qtembedded- directory
rm -rf /tmp/qtembedded*
and maybe also
rm -rf /tmp/qcop*
Software Engineer, Systems Group, MES, Trolltech
irc.freenode.net #qtopia
http://qtopia.net