Merge change 7315

* changes:
  Allow an onrestart command to stop the current service
diff --git a/init/init.c b/init/init.c
old mode 100644
new mode 100755
index 896aff8..adc4c9f
--- a/init/init.c
+++ b/init/init.c
@@ -389,12 +389,13 @@
         }
     }
 
+    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;
 }