blob: 33d30bed47ed57d46c028372456b4f6422862800 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001diff --git a/system/core/init/service-launcher.cpp b/system/core/init/service-launcher.cpp
2index 9493384..c0ce7f2 100644
3--- a/system/core/init/service-launcher.cpp
4+++ b/system/core/init/service-launcher.cpp
5@@ -1,4 +1,6 @@
6 #include <memory>
7+#include <string.h>
8+#include <stdlib.h>
9
10 #include "init_parser.h"
11 #include "service.h"
12@@ -12,6 +14,12 @@ int main(int argc, char** argv) {
13 Parser& parser = Parser::GetInstance();
14 parser.AddSectionParser("service",std::make_unique<ServiceParser>());
15 parser.ParseConfig(argv[1]);
16-
17+
18+ char serv_name[20] = {0};
19+ strncpy(serv_name, argv[1] + strlen("init."), strlen(argv[1]) - strlen("init.") - strlen(".rc"));
20+
21+ char cmd[40] = "sncfg prop_set ctl.stop ";
22+ strcat(cmd, serv_name);
23+ system(cmd);
24 return 0;
25 }