Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5998060e
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5998060e
编写于
8月 26, 2019
作者:
H
huili
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[NONE]
上级
987249f4
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
28 addition
and
23 deletion
+28
-23
packaging/deb/DEBIAN/preinst
packaging/deb/DEBIAN/preinst
+2
-0
packaging/rpm/tdengine.spec
packaging/rpm/tdengine.spec
+7
-10
packaging/tools/post.sh
packaging/tools/post.sh
+19
-13
未找到文件。
packaging/deb/DEBIAN/preinst
浏览文件 @
5998060e
...
@@ -11,6 +11,8 @@ if pidof taosd &> /dev/null; then
...
@@ -11,6 +11,8 @@ if pidof taosd &> /dev/null; then
${
csudo
}
systemctl stop taosd
||
:
${
csudo
}
systemctl stop taosd
||
:
elif
$(
which insserv &> /dev/null
)
;
then
elif
$(
which insserv &> /dev/null
)
;
then
${
csudo
}
service taosd stop
||
:
${
csudo
}
service taosd stop
||
:
elif
$(
which update-rc.d &> /dev/null
)
;
then
${
csudo
}
service taosd stop
||
:
else
else
pid
=
$(
ps
-ef
|
grep
"taosd"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
pid
=
$(
ps
-ef
|
grep
"taosd"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
${
csudo
}
kill
-9
${
pid
}
||
:
${
csudo
}
kill
-9
${
pid
}
||
:
...
...
packaging/rpm/tdengine.spec
浏览文件 @
5998060e
...
@@ -70,14 +70,6 @@ cp -r %{_compiledir}/../tests/examples/* %{buildroot}%{homepath}/exam
...
@@ -70,14 +70,6 @@ cp -r %{_compiledir}/../tests/examples/* %{buildroot}%{homepath}/exam
#Scripts executed before installation
#Scripts executed before installation
%pre
%pre
function is_using_systemd() {
if pidof systemd &> /dev/null; then
return 0
else
return 1
fi
}
csudo=""
csudo=""
if command -v sudo > /dev/null; then
if command -v sudo > /dev/null; then
csudo="sudo"
csudo="sudo"
...
@@ -85,10 +77,15 @@ fi
...
@@ -85,10 +77,15 @@ fi
# Stop the service if running
# Stop the service if running
if pidof taosd &> /dev/null; then
if pidof taosd &> /dev/null; then
if
is_using_systemd
; then
if
pidof systemd &> /dev/null
; then
${csudo} systemctl stop taosd || :
${csudo} systemctl stop taosd || :
else
elif $(which insserv &> /dev/null); then
${csudo} service taosd stop || :
elif $(which update-rc.d &> /dev/null); then
${csudo} service taosd stop || :
${csudo} service taosd stop || :
else
pid=$(ps -ef | grep "taosd" | grep -v "grep" | awk '{print $2}')
${csudo} kill -9 ${pid} || :
fi
fi
echo "Stop taosd service success!"
echo "Stop taosd service success!"
sleep 1
sleep 1
...
...
packaging/tools/post.sh
浏览文件 @
5998060e
...
@@ -38,26 +38,26 @@ if command -v sudo > /dev/null; then
...
@@ -38,26 +38,26 @@ if command -v sudo > /dev/null; then
csudo
=
"sudo"
csudo
=
"sudo"
fi
fi
initd_mod
=
0
service_mod
=
2
service_mod
=
2
if
pidof systemd &> /dev/null
;
then
if
pidof systemd &> /dev/null
;
then
service_mod
=
0
service_mod
=
0
elif
$(
which insserv &> /dev/null
)
;
then
service_mod
=
1
initd_mod
=
1
service_config_dir
=
"/etc/init.d"
elif
$(
which update-rc.d &> /dev/null
)
;
then
elif
$(
which update-rc.d &> /dev/null
)
;
then
service_mod
=
1
service_mod
=
1
initd_mod
=
2
service_config_dir
=
"/etc/init.d"
service_config_dir
=
"/etc/init.d"
else
else
service_mod
=
2
service_mod
=
2
fi
fi
function
kill_taosd
()
{
function
kill_taosd
()
{
${
csudo
}
pkill
-f
taosd
||
:
# ${csudo} pkill -f taosd || :
}
pid
=
$(
ps
-ef
|
grep
"taosd"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
${
csudo
}
kill
-9
${
pid
}
||
:
function
is_using_systemd
()
{
if
pidof systemd &> /dev/null
;
then
return
0
else
return
1
fi
}
}
function
install_include
()
{
function
install_include
()
{
...
@@ -103,12 +103,18 @@ function install_config() {
...
@@ -103,12 +103,18 @@ function install_config() {
function
clean_service_on_sysvinit
()
{
function
clean_service_on_sysvinit
()
{
restart_config_str
=
"taos:2345:respawn:
${
service_config_dir
}
/taosd start"
restart_config_str
=
"taos:2345:respawn:
${
service_config_dir
}
/taosd start"
#
if pidof taosd &> /dev/null; then
if
pidof taosd &> /dev/null
;
then
#
${csudo} service taosd stop || :
${
csudo
}
service taosd stop
||
:
#
fi
fi
${
csudo
}
sed
-i
"
\|
${
restart_config_str
}
|d"
/etc/inittab
||
:
${
csudo
}
sed
-i
"
\|
${
restart_config_str
}
|d"
/etc/inittab
||
:
${
csudo
}
rm
-f
${
service_config_dir
}
/taosd
||
:
${
csudo
}
rm
-f
${
service_config_dir
}
/taosd
||
:
${
csudo
}
update-rc.d
-f
taosd remove
||
:
if
((
${
initd_mod
}
==
1
))
;
then
${
csudo
}
grep
-q
-F
"taos"
/etc/inittab
&&
${
csudo
}
insserv
-r
taosd
||
:
elif
((
${
initd_mod
}
==
2
))
;
then
${
csudo
}
grep
-q
-F
"taos"
/etc/inittab
&&
${
csudo
}
update-rc.d
-f
taosd remove
||
:
fi
# ${csudo} update-rc.d -f taosd remove || :
${
csudo
}
init q
||
:
${
csudo
}
init q
||
:
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录