Commit for ken to fix DProc issues

This commit is contained in:
Kris Moore
2016-02-29 15:27:17 -05:00
parent e9e6abdcd6
commit 08df048c69
4 changed files with 11 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ sysadm_start()
ssl_keygen
echo "Starting sysadm..."
command="/usr/local/bin/sysadm-server"
daemon -r -p /var/run/sysadm.pid $command $flags >/dev/null 2>/dev/null
daemon -p /var/run/sysadm.pid $command $flags >/dev/null 2>/dev/null
chmod 744 /var/run/sysadm.pid >/dev/null 2>/dev/null
}

View File

@@ -127,6 +127,7 @@ DProcess* Dispatcher::queueProcess(Dispatcher::PROC_QUEUE queue, QString ID, QSt
//For multi-threading, need to emit a signal/slot for this action (object creations need to be in same thread as parent)
qDebug() << "Queue Process:" << queue << ID << cmds;
DProcess *P = createProcess(ID, cmds);
connect(this, SIGNAL(mkProcs(Dispatcher::PROC_QUEUE, DProcess*)), this, SLOT(mkProcs(Dispatcher::PROC_QUEUE, DProcess*)) );
emit mkProcs(queue, P);
return P;
}

View File

@@ -584,10 +584,14 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmIohyveRequest(const QJsonVal
}
if(act=="fetchiso"){
ok = true;
DProcess *fetchproc;
out->insert("fetchiso", sysadm::Iohyve::fetchISO(in_args.toObject(), fetchproc));
connect(fetchproc, SIGNAL(ProcessOutput(QString)), this, SLOT(slotIohyveFetchProcessOutput(QString)) );
connect(fetchproc, SIGNAL(Finished(QString, int, QString)), this, SLOT(slotIohyveFetchDone(QString, int, QString)) );
DProcess fetchproc;
qDebug() << "Before fetchiso";
out->insert("fetchiso", sysadm::Iohyve::fetchISO(in_args.toObject(), &fetchproc));
//qDebug() << "fetchProc: " << fetchproc;
qDebug() << "After fetchiso";
connect(&fetchproc, SIGNAL(ProcessOutput(QString)), this, SLOT(slotIohyveFetchProcessOutput(QString)) );
connect(&fetchproc, SIGNAL(Finished(QString, int, QString)), this, SLOT(slotIohyveFetchDone(QString, int, QString)) );
qDebug() << "After fetchiso again";
}
if(act=="install"){
ok = true;

View File

@@ -61,6 +61,7 @@ QJsonObject Iohyve::fetchISO(QJsonObject jsin, DProcess *returnproc) {
// Queue the fetch action
returnproc = DISPATCHER->queueProcess(ID, "iohyve fetch " + url);
qDebug() << "returnproc" << returnproc;
// Return some details to user that the action was queued
retObject.insert("command", "iohyve fetch " + url);