• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Revisiond939ad5b08441c276a2da611b6d0651513d59412 (tree)
Zeit2010-04-14 19:12:28
AutorBen Gruver <JesusFreke@Jesu...>
CommiterChih-Wei Huang

Log Message

Allow an onrestart command to stop the current service

For example,

service recovery /sbin/recovery
onrestart start loadkeys
onrestart class_start con
onrestart stop recovery

Previously, if you had a service like the above, the "onrestart stop
recovery" clause would not have any effect, because the restart flag
would be re-set after the stop command had executed.

This is similar to a service with the "oneshot" keyword, with the critical
difference being that it executes the other onrestart commands when the
service dies.

Ändern Zusammenfassung

Diff

--- a/init/init.c
+++ b/init/init.c
@@ -389,12 +389,13 @@ static int wait_for_one_process(int block)
389389 }
390390 }
391391
392+ svc->flags |= SVC_RESTARTING;
393+
392394 /* Execute all onrestart commands for this service. */
393395 list_for_each(node, &svc->onrestart.commands) {
394396 cmd = node_to_item(node, struct command, clist);
395397 cmd->func(cmd->nargs, cmd->args);
396398 }
397- svc->flags |= SVC_RESTARTING;
398399 notify_service_state(svc->name, "restarting");
399400 return 0;
400401 }