Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oblogproxy
提交
2da1935f
O
oblogproxy
项目概览
oceanbase
/
oblogproxy
大约 1 年 前同步成功
通知
24
Star
29
Fork
10
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oblogproxy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2da1935f
编写于
1月 01, 2022
作者:
F
Fankux
提交者:
GitHub
1月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15 from fankux/master
remaster run script
上级
a299f824
ab8b6a49
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
72 addition
and
85 deletion
+72
-85
script/run.sh
script/run.sh
+72
-85
未找到文件。
script/run.sh
浏览文件 @
2da1935f
#!/usr/bin/env bash
BIN
=
'logproxy'
cd
$(
dirname
$0
)
DEPLOY_PATH
=
$(
pwd
)
echo
"DEPLOY_PATH : "
${
DEPLOY_PATH
}
BIN
=
'logproxy'
GPID
=
0
function
is_running
()
{
DEPLOY_PATH
=
$1
PROC_BIN_NAME
=
$2
for
pid
in
`
ps ux |
grep
${
PROC_BIN_NAME
}
|
awk
'{print $2}'
`
;
do
function
is_running
()
{
for
pid
in
$(
ps ux |
grep
${
BIN
}
|
grep
-v
'bash '
|
grep
-v
grep
|
awk
'{print $2}'
)
;
do
_path
=
$(
readlink
-f
/proc/
${
pid
}
/cwd
)
if
[[
${
?
}
-eq
0
]]
&&
[[
${
_path
}
=
${
DEPLOY_PATH
}
]]
;
then
if
[[
${
?
}
-eq
0
]]
&&
[[
${
_path
}
=
=
${
DEPLOY_PATH
}
]]
;
then
GPID
=
${
pid
}
echo
"is_running : (
${
GPID
}
)
${
DEPLOY_PATH
}
${
PROC_BIN_NAME
}
is running!"
echo
"is_running : (
${
GPID
}
)
${
DEPLOY_PATH
}
${
BIN
}
is running!"
return
1
fi
done
return
0
}
function
kill_proc_9
()
{
DEPLOY_PATH
=
$1
PROC_BIN_NAME
=
$2
force
=
$3
function
kill_proc_9
()
{
force
=
$1
[[
!
-d
${
DEPLOY_PATH
}
]]
&&
{
echo
"@@@@@@@@@@@@@@@
kill_proc :
${
DEPLOY_PATH
}
invalid!"
if
[[
!
-d
${
DEPLOY_PATH
}
]]
;
then
echo
"
kill_proc :
${
DEPLOY_PATH
}
invalid!"
return
0
}
fi
retry
=
0
is_running
${
DEPLOY_PATH
}
${
PROC_BIN_NAME
}
is_running
status
=
$?
while
[[
${
status
}
-eq
1
]]
;
do
if
[
!
-z
${
force
}
]
;
then
...
...
@@ -41,19 +38,18 @@ function kill_proc_9()
echo
"kill_proc : (
${
GPID
}
)
${
DEPLOY_PATH
}
succ!"
fi
sleep
1
retry
=
`
expr
${
retry
}
+ 1
`
retry
=
$(
expr
${
retry
}
+ 1
)
if
[
${
retry
}
-gt
15
]
;
then
force
=
1
fi
is_running
${
DEPLOY_PATH
}
${
PROC_BIN_NAME
}
is_running
status
=
$?
done
return
0
}
start
()
{
start
()
{
stop
if
[
!
-d
"./run"
]
;
then
...
...
@@ -64,23 +60,18 @@ start()
if
[
!
-d
${
log_path
}
]
;
then
mkdir
${
log_path
}
fi
log_path
=
`
readlink
-f
${
log_path
}
`
log_path
=
$(
readlink
-f
${
log_path
}
)
chmod
u+x ./bin/
${
BIN
}
&&
./bin/
${
BIN
}
-f
./conf/conf.json &>
${
log_path
}
/out.log
&
chmod
u+x ./bin/
${
BIN
}
&&
./bin/
${
BIN
}
-f
./conf/conf.json &>
${
log_path
}
/out.log
&
if
[
$?
-ne
0
]
;
then
exit
-1
fi
is_running
${
deploy_path
}
${
BIN
}
is_running
}
stop
()
{
cd
`
dirname
$0
`
echo
"work path : "
`
pwd
`
deploy_path
=
`
pwd
`
kill_proc_9
${
deploy_path
}
${
BIN
}
stop
()
{
kill_proc_9
}
case
C
"
$1
"
in
...
...
@@ -97,11 +88,7 @@ Cdebug)
echo
"
${
BIN
}
started!"
;;
Cstatus
)
cd
`
dirname
$0
`
echo
"work path : "
`
pwd
`
deploy_path
=
`
pwd
`
is_running
${
deploy_path
}
${
BIN
}
is_running
status
=
$?
echo
"status :
${
status
}
"
exit
${
status
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录