mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-19 22:48:01 +02:00
2023-01-04 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdpadengined(8) that caused two instances of a pypad script to be started when adding a single instance in rdadmin(1). * Fixed a bug in rdpadengined(8) that caused failed to clean up properly after a failed pypad script startup. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
9cccb7dadb
commit
2f295ccb9e
@ -23896,3 +23896,9 @@
|
||||
2023-01-04 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Corrected inaccuracies in the description of the 'Dropbox Instances'
|
||||
notification type in the Notifications protocol documentation.
|
||||
2023-01-04 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a bug in rdpadengined(8) that caused two instances of a
|
||||
pypad script to be started when adding a single instance in
|
||||
rdadmin(1).
|
||||
* Fixed a bug in rdpadengined(8) that caused failed to clean up
|
||||
properly after a failed pypad script startup.
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A container class for a Rivendell Notification message.
|
||||
//
|
||||
// (C) Copyright 2018-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2018-2023 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
|
||||
@ -21,8 +21,8 @@
|
||||
#ifndef RDNOTIFICATION_H
|
||||
#define RDNOTIFICATION_H
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qvariant.h>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
class RDNotification
|
||||
{
|
||||
|
@ -149,6 +149,7 @@ void MainObject::notificationReceivedData(RDNotification *notify)
|
||||
int id=notify->id().toUInt();
|
||||
switch(notify->action()) {
|
||||
case RDNotification::AddAction:
|
||||
if(pad_instances.value(id)==NULL) {
|
||||
sql=QString("select `ID` from `PYPAD_INSTANCES` where ")+
|
||||
QString::asprintf("`ID`=%u && ",id)+
|
||||
"STATION_NAME='"+RDEscapeString(rda->station()->name())+"'";
|
||||
@ -157,6 +158,7 @@ void MainObject::notificationReceivedData(RDNotification *notify)
|
||||
StartScript(id);
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
break;
|
||||
|
||||
case RDNotification::DeleteAction:
|
||||
@ -183,7 +185,13 @@ void MainObject::notificationReceivedData(RDNotification *notify)
|
||||
|
||||
void MainObject::instanceStartedData(int id)
|
||||
{
|
||||
RDProcess *proc=NULL;
|
||||
|
||||
SetRunStatus(id,true);
|
||||
if((proc=pad_instances.value(id))!=NULL) {
|
||||
rda->syslog(LOG_INFO,"%s",(QString("started: ")+proc->program()+" "+
|
||||
proc->arguments().join(" ")).toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -201,6 +209,8 @@ void MainObject::instanceFinishedData(int id)
|
||||
if(proc->process()->exitCode()==0) {
|
||||
SetRunStatus(id,false);
|
||||
bool no_restart=(bool)proc->privateData();
|
||||
rda->syslog(LOG_INFO,"%s",(QString("stopped: ")+proc->program()+" "+
|
||||
proc->arguments().join(" ")).toUtf8().constData());
|
||||
proc->deleteLater();
|
||||
pad_instances.remove(id);
|
||||
if(!no_restart) {
|
||||
@ -214,6 +224,8 @@ void MainObject::instanceFinishedData(int id)
|
||||
SetRunStatus(id,false,proc->process()->exitCode(),
|
||||
proc->standardErrorData());
|
||||
}
|
||||
proc->deleteLater();
|
||||
pad_instances.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,7 +283,7 @@ void MainObject::StartScript(unsigned id)
|
||||
args.push_back(QString::asprintf("%u",RD_PAD_CLIENT_TCP_PORT));
|
||||
args.push_back(QString::asprintf("$%u",id));
|
||||
pad_instances.value(id)->start(RD_PYPAD_PYTHON_PATH,args);
|
||||
rda->syslog(LOG_INFO,"%s",(QString("starting: ")+proc->program()+" "+
|
||||
rda->syslog(LOG_DEBUG,"%s",(QString("starting: ")+proc->program()+" "+
|
||||
proc->arguments().join(" ")).toUtf8().constData());
|
||||
}
|
||||
delete q;
|
||||
|
Loading…
x
Reference in New Issue
Block a user