diff --git a/services/init/init_common_service.c b/services/init/init_common_service.c index 5ea16132c9a0bdab5f05179a33313c7d3bfb771a..43e458e07dbc8ceeed0f05989f2ace310970fc89 100755 --- a/services/init/init_common_service.c +++ b/services/init/init_common_service.c @@ -262,6 +262,16 @@ static int BindCpuCore(Service *service) return SERVICE_SUCCESS; } +static void ClearEnvironment(void) +{ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGCHLD); + sigaddset(&mask, SIGTERM); + sigprocmask(SIG_UNBLOCK, &mask, NULL); + return; +} + int ServiceStart(Service *service) { INIT_ERROR_CHECK(service != NULL, return SERVICE_FAILURE, "start service failed! null ptr."); @@ -289,6 +299,8 @@ int ServiceStart(Service *service) DoJobNow(service->serviceJobs.jobsName[JOB_ON_START]); } + (void)ClearEnvironment(); + if (!IsOnDemandService(service)) { int ret = CreateServiceSocket(service); INIT_ERROR_CHECK(ret >= 0, return SERVICE_FAILURE,