Results 1 to 2 of 2

Thread: Qt app. DNS resolution fails when started on system startup using upstart

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt app. DNS resolution fails when started on system startup using upstart

    Hi all,

    I have currently using Ubuntu Linux 10.04 LTS (x86-64), using Qt from Ubuntu's software distribution (Qt v4.6.2).

    I have an application that needs to start on system startup. So I am using Ubuntu's upstart to start the the application.

    This application performs a DNS resolution (hostname to IP) which is failing if started using upstart, but works once I run the application on Terminal when I log in; I've made sure the upstart job starts on Ubuntu's Run Level 2.

    The specific Qt API I am using is QHostInfo::fromName. The specific error (obtained via QHostInfo.error() and QHostInfo.errorString() instance methods) is Host not found.

    I thought it was a Ubuntu's run level problem, so I try to issue a dig command in the upstart job to see if that works; dig works fine, just my app. doesn't.

    Another strange thing. Even if the DNS resolution works (when I run it on Terminal after logging in), the error message from QHostInfo is Unknown error

    I have attached the Qt Creator project with the section of app. in question (binary to be placed in /usr/local/bin for this upstart script). As well I've attached my Ubuntu upstart script (to be placed in /etc/init and its I/O streams directed to /var/log/qthostnameres/log.log - a file which should be created beforehand).

    I've also attempted to run the app. as a non-admin. user using su but get the same error result.

    Any past experiences, solutions, suggestions? Have I done something really silly here?

    Thanks.
    Attached Files Attached Files

Similar Threads

  1. Qt app in linux startup
    By qtlinuxnewbie in forum Newbie
    Replies: 8
    Last Post: 2nd March 2010, 18:37
  2. QT Creator crashed on startup
    By eloos in forum Qt Tools
    Replies: 13
    Last Post: 20th November 2009, 08:50
  3. Replies: 5
    Last Post: 19th September 2008, 15:24
  4. Switching between console and GUI on startup
    By EricF in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 19:03
  5. QToolBar go away! On startup anyway.
    By bitChanger in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2006, 18:22

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.