Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
862051c8
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
接近 2 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
862051c8
编写于
10月 21, 2021
作者:
O
openharmony_ci
提交者:
Gitee
10月 21, 2021
浏览文件
操作
浏览文件
下载
差异文件
!147 修改init
Merge pull request !147 from 熊磊/init10200
上级
04ecd45d
ab130c7a
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
32 addition
and
80 deletion
+32
-80
initsync/include/init_stage.h
initsync/include/init_stage.h
+1
-1
services/BUILD.gn
services/BUILD.gn
+1
-1
services/include/init_jobs.h
services/include/init_jobs.h
+0
-52
services/init/adapter/init_adapter.c
services/init/adapter/init_adapter.c
+1
-1
services/init/include/device.h
services/init/include/device.h
+1
-1
services/init/include/init.h
services/init/include/init.h
+1
-1
services/init/include/init_adapter.h
services/init/include/init_adapter.h
+1
-1
services/init/include/init_cmds.h
services/init/include/init_cmds.h
+1
-1
services/init/include/init_jobs_internal.h
services/init/include/init_jobs_internal.h
+1
-1
services/init/include/init_service.h
services/init/include/init_service.h
+1
-1
services/init/include/init_service_manager.h
services/init/include/init_service_manager.h
+1
-1
services/init/init_capability.c
services/init/init_capability.c
+1
-1
services/init/init_common_cmds.c
services/init/init_common_cmds.c
+1
-1
services/init/init_config.c
services/init/init_config.c
+1
-1
services/init/init_service_manager.c
services/init/init_service_manager.c
+2
-1
services/init/init_service_socket.c
services/init/init_service_socket.c
+2
-2
services/init/lite/init.c
services/init/lite/init.c
+1
-1
services/init/lite/init_cmds.c
services/init/lite/init_cmds.c
+1
-1
services/init/lite/init_jobs.c
services/init/lite/init_jobs.c
+1
-1
services/init/lite/init_service.c
services/init/lite/init_service.c
+1
-1
services/init/lite/init_signal_handler.c
services/init/lite/init_signal_handler.c
+1
-1
services/init/main.c
services/init/main.c
+1
-1
services/init/standard/device.c
services/init/standard/device.c
+1
-1
services/init/standard/init.c
services/init/standard/init.c
+1
-1
services/init/standard/init_jobs.c
services/init/standard/init_jobs.c
+1
-1
services/init/standard/init_service.c
services/init/standard/init_service.c
+4
-1
services/test/unittest/common/BUILD.gn
services/test/unittest/common/BUILD.gn
+1
-1
services/test/unittest/common/cmd_func_test.cpp
services/test/unittest/common/cmd_func_test.cpp
+1
-1
未找到文件。
initsync/include/init_stage.h
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/BUILD.gn
浏览文件 @
862051c8
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# You may obtain a copy of the License at
...
...
services/include/init_jobs.h
已删除
100755 → 0
浏览文件 @
04ecd45d
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef BASE_STARTUP_INITLITE_JOBS_H
#define BASE_STARTUP_INITLITE_JOBS_H
#ifdef __cplusplus
#if __cplusplus
extern
"C"
{
#endif
#endif
#define MAX_CMD_NAME_LEN 32
#define MAX_CMD_CNT_IN_ONE_JOB 200
#define MAX_CMD_CONTENT_LEN 256
#define MAX_JOB_NAME_LEN 64
// one cmd line
typedef
struct
{
char
name
[
MAX_CMD_NAME_LEN
+
1
];
// cmd name
char
cmdContent
[
MAX_CMD_CONTENT_LEN
+
1
];
// 256 cmd content
}
CmdLine
;
typedef
struct
{
int
cmdNum
;
CmdLine
cmds
[
0
];
}
CmdLines
;
// one job, could have many cmd lines
typedef
struct
{
char
name
[
MAX_JOB_NAME_LEN
+
1
];
int
cmdLinesCnt
;
CmdLine
*
cmdLines
;
}
Job
;
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif // BASE_STARTUP_INITLITE_JOBS_H
services/init/adapter/init_adapter.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/include/device.h
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/include/init.h
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/include/init_adapter.h
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/include/init_cmds.h
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/include/init_jobs_internal.h
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/include/init_service.h
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/include/init_service_manager.h
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/init_capability.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/init_common_cmds.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/init_config.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/init_service_manager.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -308,6 +308,7 @@ static int AddServiceSocket(cJSON *json, Service *service)
...
@@ -308,6 +308,7 @@ static int AddServiceSocket(cJSON *json, Service *service)
ServiceSocket
*
sockopt
=
(
ServiceSocket
*
)
calloc
(
1
,
sizeof
(
ServiceSocket
)
+
strlen
(
opt
[
SERVICE_SOCK_NAME
])
+
1
);
ServiceSocket
*
sockopt
=
(
ServiceSocket
*
)
calloc
(
1
,
sizeof
(
ServiceSocket
)
+
strlen
(
opt
[
SERVICE_SOCK_NAME
])
+
1
);
INIT_INFO_CHECK
(
sockopt
!=
NULL
,
return
SERVICE_FAILURE
,
"Failed to malloc for socket %s"
,
opt
[
SERVICE_SOCK_NAME
]);
INIT_INFO_CHECK
(
sockopt
!=
NULL
,
return
SERVICE_FAILURE
,
"Failed to malloc for socket %s"
,
opt
[
SERVICE_SOCK_NAME
]);
sockopt
->
sockFd
=
-
1
;
int
ret
=
strcpy_s
(
sockopt
->
name
,
strlen
(
opt
[
SERVICE_SOCK_NAME
])
+
1
,
opt
[
SERVICE_SOCK_NAME
]);
int
ret
=
strcpy_s
(
sockopt
->
name
,
strlen
(
opt
[
SERVICE_SOCK_NAME
])
+
1
,
opt
[
SERVICE_SOCK_NAME
]);
INIT_INFO_CHECK
(
ret
==
0
,
free
(
sockopt
);
INIT_INFO_CHECK
(
ret
==
0
,
free
(
sockopt
);
return
SERVICE_FAILURE
,
"Failed to copy socket name %s"
,
opt
[
SERVICE_SOCK_NAME
]);
return
SERVICE_FAILURE
,
"Failed to copy socket name %s"
,
opt
[
SERVICE_SOCK_NAME
]);
...
...
services/init/init_service_socket.c
浏览文件 @
862051c8
...
@@ -59,7 +59,7 @@ static int CreateSocket(ServiceSocket *sockopt)
...
@@ -59,7 +59,7 @@ static int CreateSocket(ServiceSocket *sockopt)
do
{
do
{
ret
=
-
1
;
ret
=
-
1
;
if
(
access
(
addr
.
sun_path
,
F_OK
))
{
if
(
access
(
addr
.
sun_path
,
F_OK
)
==
0
)
{
INIT_LOGI
(
"%s already exist, remove it"
,
addr
.
sun_path
);
INIT_LOGI
(
"%s already exist, remove it"
,
addr
.
sun_path
);
unlink
(
addr
.
sun_path
);
unlink
(
addr
.
sun_path
);
}
}
...
@@ -146,4 +146,4 @@ void CloseServiceSocket(ServiceSocket *sockopt)
...
@@ -146,4 +146,4 @@ void CloseServiceSocket(ServiceSocket *sockopt)
tmpSock
=
tmpSock
->
next
;
tmpSock
=
tmpSock
->
next
;
}
}
return
;
return
;
}
}
\ No newline at end of file
services/init/lite/init.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/lite/init_cmds.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/lite/init_jobs.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/lite/init_service.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/lite/init_signal_handler.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/main.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/standard/device.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/standard/init.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/standard/init_jobs.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
services/init/standard/init_service.c
浏览文件 @
862051c8
/*
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 202
0-202
1 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -68,6 +68,9 @@ int ServiceExec(const Service *service)
...
@@ -68,6 +68,9 @@ int ServiceExec(const Service *service)
_exit
(
0x7f
);
// 0x7f: user specified
_exit
(
0x7f
);
// 0x7f: user specified
}
}
}
}
if
(
unsetenv
(
"UV_THREADPOOL_SIZE"
)
!=
0
)
{
INIT_LOGE
(
"set UV_THREADPOOL_SIZE error : %d."
,
errno
);
}
// L2 Can not be reset env
// L2 Can not be reset env
if
(
execv
(
service
->
pathArgs
.
argv
[
0
],
service
->
pathArgs
.
argv
)
!=
0
)
{
if
(
execv
(
service
->
pathArgs
.
argv
[
0
],
service
->
pathArgs
.
argv
)
!=
0
)
{
INIT_LOGE
(
"service %s execve failed! err %d."
,
service
->
name
,
errno
);
INIT_LOGE
(
"service %s execve failed! err %d."
,
service
->
name
,
errno
);
...
...
services/test/unittest/common/BUILD.gn
浏览文件 @
862051c8
# Copyright (c) 202
1
Huawei Device Co., Ltd.
# Copyright (c) 202
0
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# You may obtain a copy of the License at
...
...
services/test/unittest/common/cmd_func_test.cpp
浏览文件 @
862051c8
/*
/*
* Copyright (c) 202
1
Huawei Device Co., Ltd.
* Copyright (c) 202
0
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录