/base/startup/init/interfaces/innerkits/service_control/ |
D | service_control.c | 72 static int StopProcess(const char *serviceName) in StopProcess() argument 74 BEGET_ERROR_CHECK(serviceName != NULL, return -1, "Service name is null."); in StopProcess() 75 return SystemSetParameter("ohos.ctl.stop", serviceName); in StopProcess() 78 static int GetCurrentServiceStatus(const char *serviceName, ServiceStatus *status) in GetCurrentServiceStatus() argument 82 "%s.%s", STARTUP_SERVICE_CTL, serviceName) == -1) { in GetCurrentServiceStatus() 91 static int RestartProcess(const char *serviceName, const char *extArgv[], int extArgc) in RestartProcess() argument 93 BEGET_ERROR_CHECK(serviceName != NULL, return -1, "Service name is null."); in RestartProcess() 95 if (GetCurrentServiceStatus(serviceName, &status) != 0) { in RestartProcess() 99 BEGET_LOGE("Process service %s status: %d ", serviceName, status); in RestartProcess() 101 if (StopProcess(serviceName) != 0) { in RestartProcess() [all …]
|
/base/startup/init/test/moduletest/ |
D | service_control_test.cpp | 45 std::string serviceName = "media_service"; variable 46 auto status = GetServiceStatus(serviceName); 48 int ret = ServiceControl(serviceName.c_str(), STOP); 50 … ret = ServiceWaitForStatus(serviceName.c_str(), SERVICE_STOPPED, WAIT_SERVICE_STATUS_TIMEOUT); 53 std::cout << serviceName << " in invalid status " << status << std::endl; 54 std::cout << "Debug " << serviceName << " in unexpected status " << status << std::endl; 59 int ret = ServiceControl(serviceName.c_str(), START); 61 ret = ServiceWaitForStatus(serviceName.c_str(), SERVICE_STARTED, WAIT_SERVICE_STATUS_TIMEOUT); 63 status = GetServiceStatus(serviceName); 64 std::cout << "Debug " << serviceName << " in status " << status << std::endl; [all …]
|
D | service_watcher_moduleTest.cpp | 46 string serviceName = "test.Service"; variable 47 int ret = ServiceWatchForStatus(serviceName.c_str(), ServiceStatusChange); 49 auto status = GetServiceStatus(serviceName); 57 string serviceName = "media_service"; variable 58 auto status = GetServiceStatus(serviceName); 60 int ret = ServiceControl(serviceName.c_str(), STOP); 63 std::cout << serviceName << " in invalid status " << status << std::endl; 66 int ret = ServiceWatchForStatus(serviceName.c_str(), ServiceStatusChange); 68 status = GetServiceStatus(serviceName); 76 const std::string serviceName = "deviceinfoservice"; variable [all …]
|
/base/startup/init/interfaces/innerkits/include/ |
D | service_control.h | 49 int ServiceControlWithExtra(const char *serviceName, int action, const char *extArgv[], int extArgc… 50 int ServiceControl(const char *serviceName, int action); 51 int ServiceWaitForStatus(const char *serviceName, ServiceStatus status, int waitTimeout); 52 int ServiceSetReady(const char *serviceName); 53 int StartServiceByTimer(const char *serviceName, uint64_t timeout); 54 int StopServiceTimer(const char *serviceName);
|
D | fd_holder.h | 24 int *ServiceGetFd(const char *serviceName, size_t *fdCount); 29 int ServiceSaveFdWithPoll(const char *serviceName, int *fds, int fdCount); 34 int ServiceSaveFd(const char *serviceName, int *fds, int fdCount);
|
/base/security/selinux_adapter/interfaces/policycoreutils/src/ |
D | service_checker.cpp | 67 extern "C" int HdfGetServiceCheck(pid_t callingPid, const char *serviceName) in HdfGetServiceCheck() argument 69 if (serviceName == nullptr) { in HdfGetServiceCheck() 72 return ServiceChecker::GetInstance().GetServiceCheck(callingPid, serviceName); in HdfGetServiceCheck() 75 extern "C" int HdfAddServiceCheck(pid_t callingPid, const char *serviceName) in HdfAddServiceCheck() argument 77 if (serviceName == nullptr) { in HdfAddServiceCheck() 80 return ServiceChecker::GetInstance().AddServiceCheck(callingPid, serviceName); in HdfAddServiceCheck() 143 contextBuff.serviceName = name; in DecodeString() 154 static int CheckServiceNameValid(const std::string &serviceName) in CheckServiceNameValid() argument 156 if (serviceName.empty() || serviceName[0] == '.') { in CheckServiceNameValid() 179 if (!tmpInfo.serviceContext.empty() && !tmpInfo.serviceName.empty()) { in ServiceContextsLoad() [all …]
|
/base/security/selinux_adapter/interfaces/tools/service_check/ |
D | test.cpp | 37 std::string serviceName; member 77 input.serviceName = optarg; in SetOptions() 107 static void TestAddService(bool isHdf, const std::string &serviceName) in TestAddService() argument 109 if (!serviceName.empty()) { in TestAddService() 110 std::cout << GetErrStr(isHdf ? HdfAddServiceCheck(getpid(), serviceName.c_str()) in TestAddService() 111 : g_service->AddServiceCheck(getpid(), serviceName)) in TestAddService() 123 static void TestGetService(bool isHdf, const std::string &serviceName) in TestGetService() argument 125 if (!serviceName.empty()) { in TestGetService() 126 std::cout << GetErrStr(isHdf ? HdfGetServiceCheck(getpid(), serviceName.c_str()) in TestGetService() 127 : g_service->GetServiceCheck(getpid(), serviceName)) in TestGetService() [all …]
|
/base/hiviewdfx/hiview/test/moduletest/common/ |
D | hiview_plugin_platform_module_test.cpp | 46 int GetServicePid(const std::string& serviceName) in GetServicePid() argument 48 std::string cmd = "pidof " + serviceName; in GetServicePid() 52 printf("the pid of service(%s) is %s \n", serviceName.c_str(), pidStr.c_str()); in GetServicePid() 56 void WaitForServiceReady(const std::string& serviceName) in WaitForServiceReady() argument 58 int pid = GetServicePid(serviceName); in WaitForServiceReady() 60 std::string cmd = "start " + serviceName; in WaitForServiceReady() 64 pid = GetServicePid(serviceName); in WaitForServiceReady()
|
/base/startup/init/interfaces/innerkits/fd_holder/ |
D | fd_holder.c | 47 STATIC int BuildSendData(char *buffer, size_t size, const char *serviceName, bool hold, bool poll) in BuildSendData() argument 49 if (buffer == NULL || size == 0 || serviceName == 0) { in BuildSendData() 67 if (snprintf_s(buffer, size, size - 1, "%s|%s|%s", serviceName, holdString, pollString) == -1) { in BuildSendData() 74 static int ServiceSendFds(const char *serviceName, int *fds, int fdCount, bool doPoll) in ServiceSendFds() argument 86 int ret = BuildSendData(sendBuffer, sizeof(sendBuffer), serviceName, true, doPoll); in ServiceSendFds() 122 int ServiceSaveFd(const char *serviceName, int *fds, int fdCount) in ServiceSaveFd() argument 125 if (serviceName == NULL || fds == NULL || in ServiceSaveFd() 130 return ServiceSendFds(serviceName, fds, fdCount, false); in ServiceSaveFd() 133 int ServiceSaveFdWithPoll(const char *serviceName, int *fds, int fdCount) in ServiceSaveFdWithPoll() argument 136 if (serviceName == NULL || fds == NULL || in ServiceSaveFdWithPoll() [all …]
|
/base/security/selinux_adapter/interfaces/policycoreutils/include/ |
D | service_checker.h | 24 std::string serviceName = ""; member 34 int GetServiceCheck(const pid_t callingPid, const std::string &serviceName); 38 int AddServiceCheck(const pid_t callingPid, const std::string &serviceName); 44 int CheckPerm(const pid_t callingPid, const std::string &serviceName, std::string action); 45 int GetServiceContext(const std::string &serviceName, std::string &context);
|
D | hdf_service_checker.h | 25 int HdfGetServiceCheck(pid_t callingPid, const char *serviceName); 26 int HdfAddServiceCheck(pid_t callingPid, const char *serviceName);
|
/base/startup/init/services/modules/selinux/ |
D | selinux_static.c | 33 PLUGIN_CHECK(fieldStr != NULL, return, "No secon item in %s", serviceParseCtx->serviceName); in ServiceParseSelinuxHook() 34 PLUGIN_LOGV("Cfg %s for %s", fieldStr, serviceParseCtx->serviceName); in ServiceParseSelinuxHook() 35 DelServiceExtData(serviceParseCtx->serviceName, HOOK_ID_SELINUX); in ServiceParseSelinuxHook() 36 … AddServiceExtData(serviceParseCtx->serviceName, HOOK_ID_SELINUX, fieldStr, strlen(fieldStr) + 1); in ServiceParseSelinuxHook()
|
/base/startup/init/services/begetctl/ |
D | sandbox.cpp | 112 static void RunCmd(const std::string &serviceName, const std::string &namespaceName, const std::str… in RunCmd() argument 114 if (!namespaceName.empty() && processName.empty() && serviceName.empty()) { in RunCmd() 117 } else if (!namespaceName.empty() && !processName.empty() && serviceName.empty()) { in RunCmd() 120 } else if (namespaceName.empty() && !processName.empty() && serviceName.empty()) { in RunCmd() 124 } else if (namespaceName.empty() && processName.empty() && !serviceName.empty()) { in RunCmd() 125 std::cout << "enter sandbox service name " << serviceName << std::endl; in RunCmd() 126 CmdClientInit(INIT_CONTROL_FD_SOCKET_PATH, ACTION_SANDBOX, serviceName.c_str()); in RunCmd() 136 std::string serviceName {}; in main_cmd() local 144 serviceName = optarg; in main_cmd() 155 serviceName = optarg; in main_cmd() [all …]
|
/base/startup/init/interfaces/innerkits/service_watcher/ |
D | service_watcher.c | 50 int ServiceWatchForStatus(const char *serviceName, ServiceStatusChangePtr changeCallback) in ServiceWatchForStatus() argument 52 …BEGET_ERROR_CHECK(serviceName != NULL, return EC_INVALID, "Service watch failed, service is null."… in ServiceWatchForStatus() 56 BEGET_LOGI("Watcher service %s status", serviceName); in ServiceWatchForStatus() 58 "%s.%s", STARTUP_SERVICE_CTL, serviceName) == -1) { in ServiceWatchForStatus() 64 BEGET_LOGE("Failed to watcher service %s ret %d.", serviceName, ret); in ServiceWatchForStatus()
|
/base/useriam/user_auth_framework/test/unittest/executors/ |
D | driver_manager_unit_test.cpp | 61 std::string serviceName = "mockDriver"; variable 67 hdiName2Config.emplace(serviceName, config); 69 EXPECT_EQ(DriverManager::GetInstance().GetDriverByServiceName(serviceName), nullptr); 72 DriverManager::GetInstance().GetDriverByServiceName(serviceName); 81 std::string serviceName = "mockDriver"; variable 87 hdiName2Config.emplace(serviceName, config);
|
/base/startup/init/services/modules/init_hook/ |
D | init_hook.h | 47 ServiceExtData *AddServiceExtData(const char *serviceName, uint32_t id, void *data, uint32_t dataLe… 48 void DelServiceExtData(const char *serviceName, uint32_t id); 49 ServiceExtData *GetServiceExtData(const char *serviceName, uint32_t id);
|
D | init_hook.c | 43 ServiceExtData *AddServiceExtData(const char *serviceName, uint32_t id, void *data, uint32_t dataLe… in AddServiceExtData() argument 45 Service *service = GetServiceByName(serviceName); in AddServiceExtData() 46 PLUGIN_CHECK(service != NULL, return NULL, "Can not find service for %s", serviceName); in AddServiceExtData() 69 void DelServiceExtData(const char *serviceName, uint32_t id) in DelServiceExtData() argument 71 Service *service = GetServiceByName(serviceName); in DelServiceExtData() 72 PLUGIN_CHECK(service != NULL, return, "Can not find service for %s", serviceName); in DelServiceExtData() 81 ServiceExtData *GetServiceExtData(const char *serviceName, uint32_t id) in GetServiceExtData() argument 83 Service *service = GetServiceByName(serviceName); in GetServiceExtData() 84 PLUGIN_CHECK (service != NULL, return NULL, "Can not find service for %s", serviceName); in GetServiceExtData() 137 ctx.serviceName = node->name; in CmdClear()
|
/base/useriam/user_auth_framework/frameworks/native/executors/src/ |
D | driver_manager.cpp | 107 auto driver = DriverManager::GetInstance().GetDriverByServiceName(status.serviceName); in SubscribeHdiDriverStatus() 112 …IAM_LOGI("service %{public}s receive status %{public}d", status.serviceName.c_str(), status.status… in SubscribeHdiDriverStatus() 115 IAM_LOGI("service %{public}s status change to start", status.serviceName.c_str()); in SubscribeHdiDriverStatus() 119 … UserIam::UserAuth::ReportSystemFault(Common::GetNowTimeString(), status.serviceName); in SubscribeHdiDriverStatus() 120 IAM_LOGI("service %{public}s status change to stop", status.serviceName.c_str()); in SubscribeHdiDriverStatus() 124 IAM_LOGI("service %{public}s status ignored", status.serviceName.c_str()); in SubscribeHdiDriverStatus() 230 std::shared_ptr<Driver> DriverManager::GetDriverByServiceName(const std::string &serviceName) in GetDriverByServiceName() argument 234 auto driverIter = serviceName2Driver_.find(serviceName); in GetDriverByServiceName()
|
/base/startup/init/services/modules/bootevent/ |
D | bootevent.c | 56 static int AddServiceBootEvent(const char *serviceName, const char *paramName) in AddServiceBootEvent() argument 68 extData = AddServiceExtData(serviceName, i, NULL, sizeof(BOOT_EVENT_PARAM_ITEM)); in AddServiceBootEvent() 84 DelServiceExtData(serviceName, extData->dataId); in AddServiceBootEvent() 214 context.serviceName = name; in SetServiceBooteventHookMgr() 273 ctx.serviceName = serviceParseCtx->serviceName; in ServiceParseBootEventHook() 277 if (AddServiceBootEvent(serviceParseCtx->serviceName, in ServiceParseBootEventHook() 279 INIT_LOGI("Add service bootEvent failed %s", serviceParseCtx->serviceName); in ServiceParseBootEventHook() 283 … SetServiceBooteventHookMgr(serviceParseCtx->serviceName, 1); // 1: bootevent service is starting in ServiceParseBootEventHook() 291 if (AddServiceBootEvent(serviceParseCtx->serviceName, in ServiceParseBootEventHook() 293 INIT_LOGI("Add service bootEvent failed %s", serviceParseCtx->serviceName); in ServiceParseBootEventHook() [all …]
|
/base/startup/init/services/init/standard/ |
D | fd_holder_service.c | 58 static void SendErrorInfo(int sock, const char *errInfo, const char *serviceName) in SendErrorInfo() argument 87 INIT_LOGE("Failed to send err info to service \' %s \', err = %d", serviceName, errno); in SendErrorInfo() 136 char *serviceName = msg[0]; in HandlerFdHolder() local 140 Service *service = GetServiceByName(serviceName); in HandlerFdHolder() 142 SendErrorInfo(sock, "Invalid service", serviceName); in HandlerFdHolder() 151 INIT_LOGI("Service \' %s \' request init to %s fds", serviceName, action); in HandlerFdHolder()
|
/base/location/services/location_geocode/geocode/source/ |
D | geo_convert_service.cpp | 127 std::string serviceName; in ConnectService() local 128 bool result = LocationConfigManager::GetInstance().GetGeocodeServiceName(serviceName); in ConnectService() 129 if (!result || serviceName.empty()) { in ConnectService() 139 connectionWant.SetElementName(serviceName, abilityName); in ConnectService() 177 std::string serviceName; in IsGeoConvertAvailable() local 178 bool result = LocationConfigManager::GetInstance().GetGeocodeServiceName(serviceName); in IsGeoConvertAvailable() 179 if (!result || serviceName.empty()) { in IsGeoConvertAvailable() 186 if (!CommonUtils::CheckAppInstalled(serviceName)) { // app is not installed in IsGeoConvertAvailable() 362 std::string serviceName; in GetService() local 363 bool result = LocationConfigManager::GetInstance().GetGeocodeServiceName(serviceName); in GetService() [all …]
|
/base/hiviewdfx/faultloggerd/test/moduletest/ |
D | faultloggerd_module_test.cpp | 29 void WaitForServiceReady(const std::string& serviceName) in WaitForServiceReady() argument 31 int pid = GetProcessPid(serviceName); in WaitForServiceReady() 33 std::string cmd = "start " + serviceName; in WaitForServiceReady() 37 pid = GetProcessPid(serviceName); in WaitForServiceReady()
|
/base/startup/init/services/init/include/ |
D | init_service_manager.h | 57 void StartServiceByName(const char *serviceName); 58 void StopServiceByName(const char *serviceName);
|
/base/startup/init/interfaces/innerkits/init_module_engine/include/ |
D | bootstage.h | 113 const char *serviceName; /* Service name */ member 129 const char *serviceName; /* Service name */ member 137 const char *serviceName; /* Service name */ member
|
/base/startup/init/test/exec_test/ |
D | fd_holder_test.c | 29 static void SaveFds(const char *serviceName, int argc, char **argv) in SaveFds() argument 48 int ret = ServiceSaveFd(serviceName, fds, (size_t)fdCount); in SaveFds()
|