2018-08-13 Fred Gleason <fredg@paravelsystems.com>

* Moved execution of maintenance routines from ripcd(8) to
	rdservice(8).
This commit is contained in:
Fred Gleason
2018-08-13 16:27:12 -04:00
parent ae9296352c
commit 16661cfb6d
9 changed files with 154 additions and 119 deletions

View File

@@ -89,6 +89,21 @@ MainObject::MainObject(QObject *parent)
exit(1);
}
//
// Maintenance Routine Timer
//
srandom(QTime::currentTime().msec());
svc_maint_timer=new QTimer(this);
svc_maint_timer->setSingleShot(true);
connect(svc_maint_timer,SIGNAL(timeout()),this,SLOT(checkMaintData()));
int interval=GetMaintInterval();
if(!rda->config()->disableMaintChecks()) {
svc_maint_timer->start(interval);
}
else {
rda->log(RDConfig::LogInfo,"maintenance checks disabled on this host!");
}
if(!RDWritePid(RD_PID_DIR,"rdservice.pid",getuid())) {
fprintf(stderr,"rdservice: can't write pid file\n");
}
@@ -97,6 +112,8 @@ MainObject::MainObject(QObject *parent)
void MainObject::processFinishedData(int id)
{
svc_processes[id]->deleteLater();
svc_processes.remove(id);
}