summaryrefslogtreecommitdiffstats
path: root/init/service.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2018-08-01 13:41:12 -0700
committerTom Cherry <tomcherry@google.com>2018-08-02 12:25:58 -0700
commit40acb379cdac2e71b888bfa22bdcb409aa2753b1 (patch)
tree6b13aec6b13ffb7ee635e94d5f4294233070a9d6 /init/service.cpp
parent081b710b2ee7f726f1bef282333c397006b6b37f (diff)
downloadsystem_core-40acb379cdac2e71b888bfa22bdcb409aa2753b1.tar.gz
system_core-40acb379cdac2e71b888bfa22bdcb409aa2753b1.tar.bz2
system_core-40acb379cdac2e71b888bfa22bdcb409aa2753b1.zip
Move watchdogd out of init
We're moving past a world where static executables are needed, including watchdogd, so treat this like any other executable and place it in /system/bin. Bug: 73660730 Test: watchdogd still runs Change-Id: I1f7508fd55dce6e9ee72a6ab7a085011a76c0053
Diffstat (limited to 'init/service.cpp')
-rw-r--r--init/service.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/init/service.cpp b/init/service.cpp
index 4c2747e64..d20e90a70 100644
--- a/init/service.cpp
+++ b/init/service.cpp
@@ -46,10 +46,12 @@
#include "util.h"
#if defined(__ANDROID__)
+#include <android/api-level.h>
#include <sys/system_properties.h>
#include "init.h"
#include "property_service.h"
+#include "selinux.h"
#else
#include "host_init_stubs.h"
#endif
@@ -1211,6 +1213,13 @@ Result<Success> ServiceParser::ParseSection(std::vector<std::string>&& args,
}
std::vector<std::string> str_args(args.begin() + 2, args.end());
+
+ if (SelinuxGetVendorAndroidVersion() <= __ANDROID_API_P__) {
+ if (str_args[0] == "/sbin/watchdogd") {
+ str_args[0] = "/system/bin/watchdogd";
+ }
+ }
+
service_ = std::make_unique<Service>(name, restart_action_subcontext, str_args);
return Success();
}