From 9587f4300e362cba48c39930adb25b83b73eeb50 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 25 Aug 2022 17:16:56 -0400 Subject: [PATCH] 2022-08-25 Fred Gleason * Fixed a bug in rdservice(8) that could cause a segfault when started with a previous instance running. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ rdservice/rdservice.cpp | 17 +++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6c3f3b9..17067efe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20909,3 +20909,6 @@ * Added an Online Feed Report to rdcastmanager(1). 2022-08-25 Fred Gleason * Incremented the package version to 3.6.5int3. +2022-08-25 Fred Gleason + * Fixed a bug in rdservice(8) that could cause a segfault when + started with a previous instance running. diff --git a/rdservice/rdservice.cpp b/rdservice/rdservice.cpp index 0cdb37b4..e95e4c92 100644 --- a/rdservice/rdservice.cpp +++ b/rdservice/rdservice.cpp @@ -63,14 +63,6 @@ MainObject::MainObject(QObject *parent) svc_startup_target=MainObject::TargetAll; svc_force_system_maintenance=false; - // - // Check for prior instance - // - if(RDGetPids("rdservice").size()>1) { - rda->syslog(LOG_ERR,"prior instance found"); - exit(RDApplication::ExitPriorInstance); - } - // // Open the Database // @@ -80,6 +72,15 @@ MainObject::MainObject(QObject *parent) (const char *)err_msg.utf8()); exit(RDApplication::ExitNoDb); } + + // + // Check for prior instance + // + if(RDGetPids("rdservice").size()>1) { + rda->syslog(LOG_ERR,"prior instance found"); + exit(RDApplication::ExitPriorInstance); + } + rda->syslog(LOG_DEBUG,"starting up"); //