Merge change 7315

* changes:
  Allow an onrestart command to stop the current service
This commit is contained in:
Android Code Review 2009-08-28 07:18:37 -07:00
commit e86a2c7ceb
1 changed files with 2 additions and 1 deletions

3
init/init.c Normal file → Executable file
View File

@ -389,12 +389,13 @@ static int wait_for_one_process(int block)
}
}
svc->flags |= SVC_RESTARTING;
/* Execute all onrestart commands for this service. */
list_for_each(node, &svc->onrestart.commands) {
cmd = node_to_item(node, struct command, clist);
cmd->func(cmd->nargs, cmd->args);
}
svc->flags |= SVC_RESTARTING;
notify_service_state(svc->name, "restarting");
return 0;
}