Results 1 to 7 of 7

Thread: Daemonizing a Qt application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Daemonizing a Qt application

    Just run your normal executable with &

    ./yourexe &

    or, if you don't process SIGHUP

    nohup ./yourexe &

    thats it. Nothing special needs to be done (So you don't need 'inidaemon' function)

    To kill, even if you trap signals like in your app above, just use kill:

    kill -9 <pid>

    You can't ignore or protect against kill -9

  2. The following user says thank you to squidge for this useful post:

    adutzu89 (14th March 2016)

  3. #2
    Join Date
    Dec 2009
    Posts
    19
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Daemonizing a Qt application

    Quote Originally Posted by fatjuicymole View Post
    Just run your normal executable with &

    ./yourexe &
    You should also add a command line switch to your application to suppress console output in this case, since '&' just starts executable in background and still connects current tty device to its stdout and stderr. Thus if you run your application this way you will still see it's log messages output (unless you log out).
    Or you can manually redirect output with '>'.
    Last edited by nateriver; 1st January 2010 at 03:51.
    "Do be do be do", Frank Sinatra

Similar Threads

  1. Why some application needs server(-qws)
    By nrabara in forum Newbie
    Replies: 0
    Last Post: 17th December 2009, 13:01
  2. QT3 application is not running on ARM Board
    By soumya in forum Qt for Embedded and Mobile
    Replies: 16
    Last Post: 20th July 2009, 10:13
  3. Deploying Qt 4.5.1 Application on RHEL 5.. Pls Help
    By swamyonline in forum Installation and Deployment
    Replies: 0
    Last Post: 28th June 2009, 11:43
  4. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.