Changeset 6e90b70


Ignore:
Timestamp:
07/25/14 13:50:45 (2 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.3
Children:
2b685d0
Parents:
6385128
Message:

Add a bunch more work on syscache.
1) Get the DB backend up and running (only basic jail information synced right now)
2) Setup the DB query syntax format, and add the jail info retrieval parsing for testing

Current testing strings that can be passed to the client:
jail list (list names of all currently running jails)
jail <name> id (return the JID for the desired jail)
jail <name> ip (return the IP address for the desired jail)
jail <name> path (return the system path to the jail directory)

Note: For testing purposes, these string can be passed through the client of the form:
syscache "jail list" "jail myjail id" "jail myjail ip" "jail myjail path"
This will return the list of all jails, as well as the id/ip/path of "myjail" in a single call to the cache. Eventually the client will have a simplified syntax for multiple info calls (something like "jailinfo myjail id ip path")

Location:
src-sh/syscache/daemon
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • src-sh/syscache/daemon/daemon.pro

    r8c7378d r6e90b70  
    55QT              += core network 
    66 
    7 HEADERS += syscache-daemon.h 
     7HEADERS += syscache-daemon.h \ 
     8                        DB.h 
    89                 
    910SOURCES += main.cpp \ 
    10                 syscache-daemon.cpp 
     11                syscache-daemon.cpp \ 
     12                DB.cpp 
    1113 
    1214 
  • src-sh/syscache/daemon/syscache-daemon.cpp

    r8c7378d r6e90b70  
    66    //server->setMaxPendingConnections(10); //should go through them pretty fast, no need for more 
    77    connect(server, SIGNAL(newConnection()), this, SLOT(checkForConnections())); 
     8  DATA = new DB(this); 
     9    DATA->startSync(); 
    810} 
    911 
     
    2325  if(server->isListening()){ server->close(); } 
    2426  QLocalServer::removeServer("/var/run/syscache.pipe"); //clean up 
     27  DATA->shutDown(); 
    2528  QCoreApplication::exit(0); 
    2629} 
     
    5053    qDebug() << "Request Received:" << req; 
    5154    if(req.join("")=="shutdowndaemon"){ stopdaemon=true; break; } 
    52     out << "[ERROR] No DB integration implemented yet"; 
     55    else{ out << DATA->fetchInfo(req); } 
    5356  } 
    5457  //Now write the output to the socket and disconnect it 
  • src-sh/syscache/daemon/syscache-daemon.h

    r8c7378d r6e90b70  
    1111#include <QCoreApplication> 
    1212 
     13#include "DB.h" 
     14 
    1315class SysCacheDaemon : public QObject{ 
    1416        Q_OBJECT 
     
    2224        QLocalServer *server; 
    2325        QLocalSocket *curSock; 
     26        DB *DATA; 
    2427 
    2528private slots: 
Note: See TracChangeset for help on using the changeset viewer.