mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-28 06:32:32 +02:00
Resolved conflict in 'ChangeLog'
Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
commit
0aeaa50753
14
ChangeLog
14
ChangeLog
@ -21718,5 +21718,19 @@
|
||||
2021-05-19 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Hacked the build system to make the PyPAD module install
|
||||
correctly on Debian-ish systems.
|
||||
2021-05-28 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Updated rddbmgr(8) to correctly recognize schema database
|
||||
schema 347 as belonging to v3.6.0.
|
||||
2021-05-28 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a use-after-delete bug in rdimport(1) that could cause
|
||||
a segfault when the '--fix-broken-formats' switch was given.
|
||||
2021-05-28 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added syslog DEBUG messages around the start/stop of ephemeral
|
||||
processes in rdservice(8).
|
||||
* Added an '--initial-maintenance' switch to rdservice(8).
|
||||
2021-05-28 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added an 'RDProcess::prettyCommandString()' method.
|
||||
2021-05-28 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added an '--force-system-maintenance' switch to rdservice(8).
|
||||
2021-05-31 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added symlinks to enable CGI processing in 'debian/postinst'.
|
||||
|
@ -89,8 +89,34 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--force-service-maintenance</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Force the initial maintenance run to include System maintenance,
|
||||
even if the scheduling algorithm doesn't call for it. (Useless
|
||||
except for debugging).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--initial-maintenance-interval=<replaceable>interval</replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Schedule the initial maintenance run to be started
|
||||
<replaceable>interval</replaceable> milliseconds after startup.
|
||||
(Useless except for debugging).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='exit_values'><title>Exit Values</title>
|
||||
<para>
|
||||
|
@ -60,6 +60,12 @@ QStringList RDProcess::arguments() const
|
||||
}
|
||||
|
||||
|
||||
QString RDProcess::prettyCommandString() const
|
||||
{
|
||||
return (p_program.trimmed()+" "+p_arguments.join(" ")).trimmed();
|
||||
}
|
||||
|
||||
|
||||
void RDProcess::setProcessEnvironment(const QProcessEnvironment &env)
|
||||
{
|
||||
p_process->setProcessEnvironment(env);
|
||||
|
@ -33,6 +33,7 @@ class RDProcess : public QObject
|
||||
QProcess *process() const;
|
||||
QString program() const;
|
||||
QStringList arguments() const;
|
||||
QString prettyCommandString() const;
|
||||
void setProcessEnvironment(const QProcessEnvironment &env);
|
||||
void start(const QString &program,const QStringList &args);
|
||||
QString errorText() const;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Rivendell Maintenance Routines
|
||||
//
|
||||
// (C) Copyright 2008-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2008-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -23,12 +23,15 @@
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdapplication.h>
|
||||
#include <rdconf.h>
|
||||
#include <rdpaths.h>
|
||||
|
||||
#include "rdservice.h"
|
||||
|
||||
void MainObject::checkMaintData()
|
||||
{
|
||||
rda->syslog(LOG_DEBUG,"starting maintenance checks");
|
||||
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
QDateTime current_datetime=
|
||||
@ -38,7 +41,12 @@ void MainObject::checkMaintData()
|
||||
//
|
||||
// Schedule Next Maintenance Run
|
||||
//
|
||||
svc_maint_timer->start(GetMaintInterval());
|
||||
int interval=GetMaintInterval();
|
||||
svc_maint_timer->start(interval);
|
||||
rda->syslog(LOG_DEBUG,"next maintenance run at %s [%s from now]",
|
||||
QDateTime::currentDateTime().addMSecs(interval).
|
||||
toString("hh:mm:ss").toUtf8().constData(),
|
||||
RDGetTimeLength(interval,false,false).toUtf8().constData());
|
||||
|
||||
RunLocalMaintRoutine();
|
||||
|
||||
@ -69,8 +77,9 @@ void MainObject::checkMaintData()
|
||||
//
|
||||
// Run the routines
|
||||
//
|
||||
if(run) {
|
||||
if(run||svc_force_system_maintenance) {
|
||||
RunSystemMaintRoutine();
|
||||
svc_force_system_maintenance=false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,12 +116,15 @@ int MainObject::GetMaintInterval() const
|
||||
void MainObject::RunEphemeralProcess(int id,const QString &program,
|
||||
const QStringList &args)
|
||||
{
|
||||
rda->syslog(LOG_DEBUG,"starting ephemeral process \"%s\"",
|
||||
(program+" "+args.join(" ")).trimmed().toUtf8().constData());
|
||||
svc_processes[id]=new RDProcess(id,this);
|
||||
connect(svc_processes[id],SIGNAL(finished(int)),
|
||||
this,SLOT(processFinishedData(int)));
|
||||
svc_processes[id]->start(program,args);
|
||||
if(!svc_processes[id]->process()->waitForStarted()) {
|
||||
QString err_msg=tr("unable to start")+"\""+program+"\": "+
|
||||
QString err_msg=tr("unable to start ephemeral process ")+
|
||||
"\""+(program+" "+args.join(" ")).trimmed()+"\": "+
|
||||
svc_processes[id]->errorText();
|
||||
rda->syslog(LOG_WARNING,"%s",(const char *)err_msg.toUtf8());
|
||||
delete svc_processes[id];
|
||||
|
@ -57,8 +57,11 @@ MainObject::MainObject(QObject *parent)
|
||||
{
|
||||
QString err_msg;
|
||||
RDApplication::ErrorType err_type=RDApplication::ErrorOk;
|
||||
int initial_maintenance_interval=-1;
|
||||
bool ok=false;
|
||||
|
||||
svc_startup_target=MainObject::TargetAll;
|
||||
svc_force_system_maintenance=false;
|
||||
|
||||
//
|
||||
// Check for prior instance
|
||||
@ -77,6 +80,7 @@ MainObject::MainObject(QObject *parent)
|
||||
err_msg.toUtf8().constData());
|
||||
exit(RDApplication::ExitNoDb);
|
||||
}
|
||||
rda->syslog(LOG_DEBUG,"starting up");
|
||||
|
||||
//
|
||||
// Process Startup Options
|
||||
@ -88,6 +92,19 @@ MainObject::MainObject(QObject *parent)
|
||||
svc_startup_target=target;
|
||||
rda->cmdSwitch()->setProcessed(i,true);
|
||||
}
|
||||
if(rda->cmdSwitch()->key(i)=="--force-system-maintenance") {
|
||||
svc_force_system_maintenance=true;
|
||||
rda->cmdSwitch()->setProcessed(i,true);
|
||||
}
|
||||
if(rda->cmdSwitch()->key(i)=="--initial-maintenance-interval") {
|
||||
initial_maintenance_interval=rda->cmdSwitch()->value(i).toInt(&ok);
|
||||
if(!ok) {
|
||||
fprintf(stderr,
|
||||
"rdservice: invalid \"--initial-maintenance-interval\" value\n");
|
||||
exit(4);
|
||||
}
|
||||
rda->cmdSwitch()->setProcessed(i,true);
|
||||
}
|
||||
}
|
||||
if(!rda->cmdSwitch()->processed(i)) {
|
||||
fprintf(stderr,"rdservice: unknown command-line option\n");
|
||||
@ -121,6 +138,13 @@ MainObject::MainObject(QObject *parent)
|
||||
connect(svc_maint_timer,SIGNAL(timeout()),this,SLOT(checkMaintData()));
|
||||
int interval=GetMaintInterval();
|
||||
if(!rda->config()->disableMaintChecks()) {
|
||||
if(initial_maintenance_interval>=0) {
|
||||
interval=initial_maintenance_interval;
|
||||
}
|
||||
rda->syslog(LOG_DEBUG,"initial maintenance run at %s [%s from now]",
|
||||
QDateTime::currentDateTime().addMSecs(interval).
|
||||
toString("hh:mm:ss").toUtf8().constData(),
|
||||
RDGetTimeLength(interval,false,false).toUtf8().constData());
|
||||
svc_maint_timer->start(interval);
|
||||
}
|
||||
else {
|
||||
@ -136,7 +160,22 @@ MainObject::MainObject(QObject *parent)
|
||||
|
||||
void MainObject::processFinishedData(int id)
|
||||
{
|
||||
svc_processes[id]->deleteLater();
|
||||
RDProcess *proc=svc_processes.value(id);
|
||||
if(proc->process()->exitStatus()!=QProcess::NormalExit) {
|
||||
rda->syslog(LOG_WARNING,"process \"%s\" crashed!",
|
||||
proc->prettyCommandString().toUtf8().constData());
|
||||
}
|
||||
else {
|
||||
if(proc->process()->exitCode()!=0) {
|
||||
rda->syslog(LOG_WARNING,"process \"%s\" exited with exit code %d",
|
||||
proc->prettyCommandString().toUtf8().constData(),
|
||||
proc->process()->exitCode());
|
||||
}
|
||||
else {
|
||||
rda->syslog(LOG_DEBUG,"process \"%s\" exited normally",
|
||||
proc->prettyCommandString().toUtf8().constData());
|
||||
}
|
||||
}
|
||||
svc_processes.remove(id);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Rivendell Services Manager
|
||||
//
|
||||
// (C) Copyright 2018-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2018-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -71,6 +71,7 @@ class MainObject : public QObject
|
||||
QTimer *svc_maint_timer;
|
||||
QTimer *svc_exit_timer;
|
||||
StartupTarget svc_startup_target;
|
||||
bool svc_force_system_maintenance;
|
||||
};
|
||||
|
||||
|
||||
|
@ -159,6 +159,7 @@ void MainObject::InitializeSchemaMap() {
|
||||
global_version_map["3.3"]=314;
|
||||
global_version_map["3.4"]=317;
|
||||
global_version_map["3.5"]=346;
|
||||
global_version_map["3.6"]=347;
|
||||
global_version_map["4.0"]=349;
|
||||
}
|
||||
|
||||
|
@ -1022,7 +1022,7 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
|
||||
//
|
||||
// Open the file
|
||||
//
|
||||
if(!OpenAudioFile(wavefile,wavedata)) {
|
||||
if(!OpenAudioFile(&wavefile,wavedata)) {
|
||||
delete wavedata;
|
||||
delete wavefile;
|
||||
return MainObject::FileBad;
|
||||
@ -1458,16 +1458,16 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
|
||||
}
|
||||
|
||||
|
||||
bool MainObject::OpenAudioFile(RDWaveFile *wavefile,RDWaveData *wavedata)
|
||||
bool MainObject::OpenAudioFile(RDWaveFile **wavefile,RDWaveData *wavedata)
|
||||
{
|
||||
QString orig_filename=wavefile->getName();
|
||||
QString orig_filename=(*wavefile)->getName();
|
||||
|
||||
if(!wavefile->openWave(wavedata)) {
|
||||
if(!(*wavefile)->openWave(wavedata)) {
|
||||
if(import_fix_broken_formats) {
|
||||
Log(LOG_WARNING,QString().sprintf(" File \"%s\" appears to be malformed, trying workaround ... ",
|
||||
RDGetBasePart(orig_filename).toUtf8().constData()));
|
||||
delete wavefile;
|
||||
if((wavefile=FixFile(orig_filename,wavedata))==NULL) {
|
||||
delete *wavefile;
|
||||
if(((*wavefile)=FixFile(orig_filename,wavedata))==NULL) {
|
||||
Log(LOG_WARNING,QString().sprintf("failed.\n"));
|
||||
Log(LOG_WARNING,QString().sprintf(
|
||||
" File \"%s\" is not readable or not a recognized format, skipping...\n",
|
||||
@ -1489,7 +1489,7 @@ bool MainObject::OpenAudioFile(RDWaveFile *wavefile,RDWaveData *wavedata)
|
||||
else {
|
||||
Log(LOG_WARNING,QString().sprintf(
|
||||
" File \"%s\" is not readable or not a recognized format, skipping...\n",
|
||||
RDGetBasePart(wavefile->getName()).toUtf8().constData()));
|
||||
RDGetBasePart((*wavefile)->getName()).toUtf8().constData()));
|
||||
if(!import_run) {
|
||||
NormalExit();
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ class MainObject : public QObject
|
||||
void RunDropBox();
|
||||
void ProcessFileEntry(const QString &entry);
|
||||
MainObject::Result ImportFile(const QString &filename,unsigned *cartnum);
|
||||
bool OpenAudioFile(RDWaveFile *wavefile,RDWaveData *wavedata);
|
||||
bool OpenAudioFile(RDWaveFile **wavefile,RDWaveData *wavedata);
|
||||
void VerifyFile(const QString &filename,unsigned *cartnum);
|
||||
RDWaveFile *FixFile(const QString &filename,RDWaveData *wavedata);
|
||||
bool IsWav(int fd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user