} else if (unit.compare(0, 5, "user@") == 0 ||
unit == "tlm.service" ||
unit == "resourced.service" ||
- unit == "security-manager.service" ||
- unit == "samsung-log-mgr.service") {
+ unit == "security-manager.service") {
knownSystemdUnits.push_back(unit);
}
}
{
dbus::Connection& systemDBus = dbus::Connection::getSystem();
std::set<std::string> unitsToStop;
+ pid_t p = -1;
for (pid_t pid : runtime::FileUser::getList(INTERNAL_PATH, true)) {
try {
"GetUnitByPID",
-1, "(o)", "(u)", (unsigned int)pid)
.get("(o)", &unit);
- unitsToStop.insert(unit);
+
+ if (std::string(unit) ==
+ "/org/freedesktop/systemd1/unit/samsung_2dlog_2dmgr_2eservice")
+ p = pid;
+ else
+ unitsToStop.insert(unit);
} catch (runtime::Exception &e) {
INFO(SINK, "Killing process: " + std::to_string(pid));
::kill(pid, SIGKILL);
if (!watch.waitForJob(job))
throw runtime::Exception("Stopping unit: " + unit + " failed");
}
+
+ if (::umount2("/sys/fs/cgroup", MNT_FORCE | MNT_DETACH) != 0)
+ INFO(SINK, "Failed to unmount cgroup");
+
+ if (p != -1)
+ ::kill(p, SIGKILL);
}
void showProgressUI(const std::string type)