Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Release scheduler lock while running startup/shutdown commands.

Temporarily release the scheduler lock while running any external
startup or shutdown commands.  This allows those commands to query the
backend to get the current schedule if needed.  Fixes #9363.
  • Loading branch information...
commit 966ad7d971e3c3c19a1e0c3f8b581238489c47c9 1 parent c24cf98
@gigem gigem authored
Showing with 11 additions and 4 deletions.
  1. +11 −4 mythtv/programs/mythbackend/scheduler.cpp
View
15 mythtv/programs/mythbackend/scheduler.cpp
@@ -1820,6 +1820,8 @@ void Scheduler::RunScheduler(void)
if (firstRun)
{
+ firstRun = false;
+
//the parameter given to the startup_cmd. "user" means a user
// started the BE, 'auto' means it was started automatically
QString startupParam = "user";
@@ -1853,9 +1855,12 @@ void Scheduler::RunScheduler(void)
if (!startupCommand.isEmpty())
{
startupCommand.replace("$status", startupParam);
+ schedLock.unlock();
myth_system(startupCommand);
+ schedLock.lock();
+ if (reclist_changed)
+ continue;
}
- firstRun = false;
}
PutInactiveSlavesToSleep();
@@ -2428,10 +2433,12 @@ void Scheduler::ShutdownServer(int prerollseconds, QDateTime &idleSince)
"this computer :-\n\t\t\t\t\t\t") + halt_cmd);
// and now shutdown myself
- if (!myth_system(halt_cmd))
+ schedLock.unlock();
+ unsigned int res = myth_system(halt_cmd);
+ schedLock.lock();
+ if (!res)
return;
- else
- VERBOSE(VB_IMPORTANT, "ServerHaltCommand failed, shutdown aborted");
+ VERBOSE(VB_IMPORTANT, "ServerHaltCommand failed, shutdown aborted");
}
// If we make it here then either the shutdown failed
Please sign in to comment.
Something went wrong with that request. Please try again.