rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | diff --git a/system/core/init/service-launcher.cpp b/system/core/init/service-launcher.cpp |
| 2 | index 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 | } |