Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
f69f3b30
Unverified
Commit
f69f3b30
authored
Sep 09, 2023
by
xiongguangjie
Committed by
GitHub
Sep 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docker 优雅关闭(docker stop graceful) (#2827)
parent
f26e2532
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
19 行增加
和
7 行删除
+19
-7
docker/centos7/Dockerfile.runtime
+2
-2
docker/ubuntu16.04/Dockerfile.devel
+1
-1
docker/ubuntu16.04/Dockerfile.runtime
+1
-1
docker/ubuntu18.04/Dockerfile.devel
+1
-1
docker/ubuntu18.04/Dockerfile.runtime
+1
-1
dockerfile
+1
-1
server/System.cpp
+6
-0
server/main.cpp
+6
-0
没有找到文件。
docker/centos7/Dockerfile.runtime
查看文件 @
f69f3b30
...
@@ -128,4 +128,4 @@ WORKDIR /opt/zlm
...
@@ -128,4 +128,4 @@ WORKDIR /opt/zlm
VOLUME [ "/opt/zlm/conf/","/opt/zlm/log/","opt/zlm/ffmpeg/"]
VOLUME [ "/opt/zlm/conf/","/opt/zlm/log/","opt/zlm/ffmpeg/"]
COPY --from=build /opt/build /
COPY --from=build /opt/build /
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH TZ=Asia/Shanghai
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH TZ=Asia/Shanghai
CMD ./MediaServer -c ./conf/config.ini
CMD ["./MediaServer", "-c" , "./conf/config.ini"]
\ No newline at end of file
\ No newline at end of file
docker/ubuntu16.04/Dockerfile.devel
查看文件 @
f69f3b30
...
@@ -41,4 +41,4 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \
...
@@ -41,4 +41,4 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \
make
make
ENV PATH /opt/media/ZLMediaKit/release/linux/Release/:$PATH
ENV PATH /opt/media/ZLMediaKit/release/linux/Release/:$PATH
CMD
MediaServer
CMD
["MediaServer"]
docker/ubuntu16.04/Dockerfile.runtime
查看文件 @
f69f3b30
...
@@ -60,4 +60,4 @@ RUN apt-get update && \
...
@@ -60,4 +60,4 @@ RUN apt-get update && \
WORKDIR /opt/media/bin/
WORKDIR /opt/media/bin/
COPY --from=build /opt/media/ZLMediaKit/release/linux/Release/MediaServer /opt/media/bin/MediaServer
COPY --from=build /opt/media/ZLMediaKit/release/linux/Release/MediaServer /opt/media/bin/MediaServer
ENV PATH /opt/media/bin:$PATH
ENV PATH /opt/media/bin:$PATH
CMD
MediaServer
CMD
["MediaServer"]
docker/ubuntu18.04/Dockerfile.devel
查看文件 @
f69f3b30
...
@@ -42,4 +42,4 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \
...
@@ -42,4 +42,4 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \
make
make
ENV PATH /opt/media/ZLMediaKit/release/linux/Release:$PATH
ENV PATH /opt/media/ZLMediaKit/release/linux/Release:$PATH
CMD
MediaServer
CMD
["MediaServer"]
docker/ubuntu18.04/Dockerfile.runtime
查看文件 @
f69f3b30
...
@@ -60,4 +60,4 @@ RUN apt-get update && \
...
@@ -60,4 +60,4 @@ RUN apt-get update && \
WORKDIR /opt/media/bin/
WORKDIR /opt/media/bin/
COPY --from=build /opt/media/ZLMediaKit/release/linux/Release/MediaServer /opt/media/bin/MediaServer
COPY --from=build /opt/media/ZLMediaKit/release/linux/Release/MediaServer /opt/media/bin/MediaServer
ENV PATH /opt/media/bin:$PATH
ENV PATH /opt/media/bin:$PATH
CMD
MediaServer
CMD
["MediaServer"]
dockerfile
查看文件 @
f69f3b30
...
@@ -83,4 +83,4 @@ COPY --from=build /opt/media/ZLMediaKit/release/linux/${MODEL}/MediaServer /opt/
...
@@ -83,4 +83,4 @@ COPY --from=build /opt/media/ZLMediaKit/release/linux/${MODEL}/MediaServer /opt/
COPY
--from=build /opt/media/ZLMediaKit/release/linux/${MODEL}/config.ini /opt/media/conf/
COPY
--from=build /opt/media/ZLMediaKit/release/linux/${MODEL}/config.ini /opt/media/conf/
COPY
--from=build /opt/media/ZLMediaKit/www/ /opt/media/bin/www/
COPY
--from=build /opt/media/ZLMediaKit/www/ /opt/media/bin/www/
ENV
PATH /opt/media/bin:$PATH
ENV
PATH /opt/media/bin:$PATH
CMD
["
sh","-c","./MediaServer -s default.pem -c ../conf/config.ini -l
0"]
CMD
["
./MediaServer","-s", "default.pem", "-c", "../conf/config.ini", "-l","
0"]
server/System.cpp
查看文件 @
f69f3b30
...
@@ -126,6 +126,12 @@ void System::startDaemon(bool &kill_parent_if_failed) {
...
@@ -126,6 +126,12 @@ void System::startDaemon(bool &kill_parent_if_failed) {
exit
(
0
);
exit
(
0
);
});
});
signal
(
SIGTERM
,[](
int
)
{
WarnL
<<
"收到主动退出信号,关闭父进程与子进程"
;
kill
(
pid
,
SIGINT
);
exit
(
0
);
});
do
{
do
{
int
status
=
0
;
int
status
=
0
;
if
(
waitpid
(
pid
,
&
status
,
0
)
>=
0
)
{
if
(
waitpid
(
pid
,
&
status
,
0
)
>=
0
)
{
...
...
server/main.cpp
查看文件 @
f69f3b30
...
@@ -420,6 +420,12 @@ int start_main(int argc,char *argv[]) {
...
@@ -420,6 +420,12 @@ int start_main(int argc,char *argv[]) {
sem
.
post
();
sem
.
post
();
});
// 设置退出信号
});
// 设置退出信号
signal
(
SIGTERM
,[](
int
)
{
WarnL
<<
"SIGTERM:exit"
;
signal
(
SIGTERM
,
SIG_IGN
);
sem
.
post
();
});
#if !defined(_WIN32)
#if !defined(_WIN32)
signal
(
SIGHUP
,
[](
int
)
{
mediakit
::
loadIniConfig
(
g_ini_file
.
data
());
});
signal
(
SIGHUP
,
[](
int
)
{
mediakit
::
loadIniConfig
(
g_ini_file
.
data
());
});
#endif
#endif
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论