Results 1 to 3 of 3

Thread: Communicating between processes owned by system and user

  1. #1
    Join Date
    Jan 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Communicating between processes owned by system and user

    Background, this is for a Mac and eventually Linux and Windows project. I have QT 4.6 and can control the version of QT used on the endpoints.

    Working on a design where I will have some data that will be managed by a program running with elevated privileges, potentially root (or its equivalent, sorry coming from a Unix background). I would like to have some processes talk to this data manager, things like a UI to update data. Ideally these run with no real privileges, so anyone on the box can use them. My first thought was to use QLocalServer but this does not seem to work due to permission issues.

    So imagine something my my_manager running as root (or a user account generated for this purpose like httpd for Apache) along with a UI program run by some user account and potentially a little binary or two kicked off by cron or its equivalent.

    Do I need to switch to a TCP (or UDP) solution even though all of the components will only ever run on the same machine?

    It looks like Trolltech (Nokia, whichever) is working on improving the IPC support in the framework, but it is not ready for real use. Is there something I have missed?

  2. #2
    Join Date
    Sep 2009
    Location
    Tashkent, Uzbekistan
    Posts
    107
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Communicating between processes owned by system and user

    Have a look at QtDBus module. This is good IPC but *NIX/Max specific. I don't know if it already works on MS Windows. Anyway IPC is highly dependent from the OS but you can try something universal like sockets or pipes.
    -- Tanuki

    per cauda vel vaculus cauda

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Communicating between processes owned by system and user

    Quote Originally Posted by sperry View Post
    My first thought was to use QLocalServer but this does not seem to work due to permission issues.
    What permission issues exactly? This should be working. You may need to chmod the resulting pipe to allow non-owning users to write to the pipe.

    Is there something I have missed?
    You can use QSharedMemory as well but a local socket is a good approach as well.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Communicating with a USB device in Qt?
    By N3wb in forum Qt Programming
    Replies: 7
    Last Post: 3rd May 2011, 10:30
  2. communicating between threads
    By freekill in forum Newbie
    Replies: 2
    Last Post: 27th November 2009, 08:13
  3. Replies: 1
    Last Post: 16th November 2009, 07:10
  4. Problems communicating with external editor
    By titaniumdecoy in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2009, 20:12
  5. Enumerate processes using Qt
    By Ben.Hines in forum Qt Programming
    Replies: 5
    Last Post: 14th February 2006, 15:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.