Getting the last background pid
Hi, I know that it is possible to get the last background pid using the $! command, however when I use it in my QT application I got a wrong result. Below follows an example where this procedure works
Code:
[linux@localhost ~]$ (sleep 6 && echo "A test") & Code:
./dbsync &>/dev/null & Generally it is the process that comes with the command Code:
echo $! I use QCoreApplication in my program. I do not know if it has something to do with this error. Any advice is welcome |
Quote:
|
The dbsync is the right process.
This time a better log is shown below. Probably de program calls another one, but I cannot see how it is done. Below is the log Code:
[linux@localhost ~]$ /home/linux/comm5/dbsync &> /dev/null & At this time the 5313 does not exist any more. Below the part of the program where it is started Code:
class Service : public QtService<QCoreApplication> |
More
Hi, I had already given up this problem, but recently I've got a similar problem and so I returned to think about it. I got some advances although I am far from really solving all my doubts in this issue. It follows below some considerations.
The main method to be studied is Code:
QtServiceBase::exec() http://doc.qt.digia.com/solutions/4/...base.html#exec When this method is called without arguments it calls the method Code:
Code:
getenv(char*) Code:
QProcess::startDetached(const QString) Code:
getenv(char*) Code:
int QtServiceBasePrivate::run(bool asService, const QStringList &argList) If someone could explains a bit better how the QtService class works or point some link I would thanks. Nowadays I am using a Debian distribution. |
All times are GMT -5. The time now is 09:19 AM. |