SimpleQtDev
24th May 2010, 03:45
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.
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.