提交 e212b817 编写于 作者: X xu_yuntong

ondemand

Signed-off-by: Nxu_yuntong <xu_yuntong@hoperun.com>
上级 f5dc3fa9
......@@ -20,7 +20,6 @@
]
}],
"caps" : ["DAC_OVERRIDE", "MKNOD", "CHOWN", "FOWNER"],
"critical" : [ 0, 15, 5],
"ondemand" : true,
"sandbox" : 0,
"start-mode" : "condition",
......
......@@ -525,6 +525,11 @@ void ServiceReap(Service *service)
// the service could be restart even if it is one-shot service
}
// service no need to restart if it is an ondemand service.
if (IsOnDemandService(service)) {
CheckOndemandService(service);
return;
}
if (service->attribute & SERVICE_ATTR_CRITICAL) { // critical
if (!CalculateCrashTime(service, service->crashTime, service->crashCount)) {
INIT_LOGE("Critical service \" %s \" crashed %d times, rebooting system",
......@@ -537,11 +542,6 @@ void ServiceReap(Service *service)
return;
}
}
// service no need to restart if it is an ondemand service.
if (IsOnDemandService(service)) {
CheckOndemandService(service);
return;
}
int ret = ExecRestartCmd(service);
INIT_CHECK_ONLY_ELOG(ret == SERVICE_SUCCESS, "Failed to exec restartArg for %s", service->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册