Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
b97a735d
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看板
未验证
提交
b97a735d
编写于
2月 01, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 01, 2023
浏览文件
操作
浏览文件
下载
差异文件
!1615 when critical process exit, panic instead of reboot
Merge pull request !1615 from handy/cherry-pick-1670558263
上级
c485583a
cc5ddf04
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
2 deletion
+28
-2
services/init/init_common_service.c
services/init/init_common_service.c
+1
-1
services/init/standard/init_reboot.c
services/init/standard/init_reboot.c
+5
-1
services/modules/reboot/reboot.c
services/modules/reboot/reboot.c
+22
-0
未找到文件。
services/init/init_common_service.c
浏览文件 @
b97a735d
...
@@ -535,7 +535,7 @@ void ServiceReap(Service *service)
...
@@ -535,7 +535,7 @@ void ServiceReap(Service *service)
if
(
!
CalculateCrashTime
(
service
,
service
->
crashTime
,
service
->
crashCount
))
{
if
(
!
CalculateCrashTime
(
service
,
service
->
crashTime
,
service
->
crashCount
))
{
INIT_LOGE
(
"Critical service
\"
%s
\"
crashed %d times, rebooting system"
,
INIT_LOGE
(
"Critical service
\"
%s
\"
crashed %d times, rebooting system"
,
service
->
name
,
service
->
crashCount
);
service
->
name
,
service
->
crashCount
);
ExecReboot
(
"
reboot
"
);
ExecReboot
(
"
panic
"
);
}
}
}
else
if
(
!
(
service
->
attribute
&
SERVICE_ATTR_NEED_RESTART
))
{
}
else
if
(
!
(
service
->
attribute
&
SERVICE_ATTR_NEED_RESTART
))
{
if
(
!
CalculateCrashTime
(
service
,
service
->
crashTime
,
service
->
crashCount
))
{
if
(
!
CalculateCrashTime
(
service
,
service
->
crashTime
,
service
->
crashCount
))
{
...
...
services/init/standard/init_reboot.c
浏览文件 @
b97a735d
...
@@ -25,7 +25,11 @@ void ExecReboot(const char *value)
...
@@ -25,7 +25,11 @@ void ExecReboot(const char *value)
#ifndef STARTUP_INIT_TEST
#ifndef STARTUP_INIT_TEST
// install module
// install module
InitModuleMgrInstall
(
"rebootmodule"
);
InitModuleMgrInstall
(
"rebootmodule"
);
PluginExecCmdByName
(
"reboot"
,
value
);
if
(
strstr
(
value
,
"reboot"
)
!=
NULL
)
{
PluginExecCmdByName
(
"reboot"
,
value
);
}
else
{
PluginExecCmdByName
(
value
,
value
);
}
#endif
#endif
return
;
return
;
}
}
...
...
services/modules/reboot/reboot.c
浏览文件 @
b97a735d
...
@@ -48,6 +48,26 @@ static int DoReboot(int id, const char *name, int argc, const char **argv)
...
@@ -48,6 +48,26 @@ static int DoReboot(int id, const char *name, int argc, const char **argv)
return
DoRoot_
(
"reboot"
,
RB_AUTOBOOT
);
return
DoRoot_
(
"reboot"
,
RB_AUTOBOOT
);
}
}
static
int
DoRebootPanic
(
int
id
,
const
char
*
name
,
int
argc
,
const
char
**
argv
)
{
UNUSED
(
id
);
UNUSED
(
name
);
UNUSED
(
argc
);
UNUSED
(
argv
);
// clear misc
(
void
)
UpdateMiscMessage
(
NULL
,
"reboot"
,
NULL
,
NULL
);
DoJobNow
(
"reboot"
);
#ifndef STARTUP_INIT_TEST
FILE
*
panic
=
fopen
(
"/proc/sysrq-trigger"
,
"wb"
);
if
(
panic
==
NULL
)
{
return
reboot
(
RB_AUTOBOOT
);
}
fwrite
((
void
*
)
"c"
,
1
,
1
,
panic
);
fclose
(
panic
);
#endif
return
0
;
}
static
int
DoRebootShutdown
(
int
id
,
const
char
*
name
,
int
argc
,
const
char
**
argv
)
static
int
DoRebootShutdown
(
int
id
,
const
char
*
name
,
int
argc
,
const
char
**
argv
)
{
{
UNUSED
(
id
);
UNUSED
(
id
);
...
@@ -130,6 +150,8 @@ static void RebootAdpInit(void)
...
@@ -130,6 +150,8 @@ static void RebootAdpInit(void)
AddRebootCmdExecutor
(
"updater"
,
DoRebootUpdater
);
AddRebootCmdExecutor
(
"updater"
,
DoRebootUpdater
);
AddRebootCmdExecutor
(
"charge"
,
DoRebootCharge
);
AddRebootCmdExecutor
(
"charge"
,
DoRebootCharge
);
AddRebootCmdExecutor
(
"suspend"
,
DoRebootSuspend
);
AddRebootCmdExecutor
(
"suspend"
,
DoRebootSuspend
);
AddRebootCmdExecutor
(
"panic"
,
DoRebootPanic
);
(
void
)
AddCmdExecutor
(
"panic"
,
DoRebootPanic
);
}
}
MODULE_CONSTRUCTOR
(
void
)
MODULE_CONSTRUCTOR
(
void
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录