namespace {
const char *PRIVILEGE_PLATFORM = "http://tizen.org/privilege/internal/default/platform";
-const std::vector<std::string> blackListSystemdUnits = {
- "samsung-log-mgr.service",
-};
// watches systemd jobs
class JobWatch {
bool JobWatch::waitForJob(const std::string& job) {
while(true) {
std::unique_lock<std::mutex> lock(jobsMutex);
- jobsCv.wait(lock, [this]{ return !removedJobs.empty(); });
+ bool timeout = true;
+ auto sec = std::chrono::seconds(1);
+ jobsCv.wait_for(lock, 5*sec, [this, &timeout]{
+ if (!removedJobs.empty()) {
+ timeout = false;
+ return true;
+ }
+ return false;});
+
+ if (timeout) {
+ INFO(SINK, "job: " + job + ", result: time out");
+ return false;
+ }
while(!removedJobs.empty()) {
bool match = (removedJobs.front().job == job);
}
}
- for (auto unit : blackListSystemdUnits) {
- unitsToStop.erase(unitsToStop.find(unit));
- }
-
auto stopUnit = [&systemDBus](const std::string &unit) {
INFO(SINK, "Stopping unit: " + unit);
JobWatch watch(systemDBus);