Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
24f6170b
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
24f6170b
编写于
12月 12, 2019
作者:
L
lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[update]
上级
7b4830cf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
69 addition
and
23 deletion
+69
-23
packaging/tools/make_install.sh
packaging/tools/make_install.sh
+69
-23
未找到文件。
packaging/tools/make_install.sh
浏览文件 @
24f6170b
...
...
@@ -47,21 +47,54 @@ initd_mod=0
service_mod
=
2
if
pidof systemd &> /dev/null
;
then
service_mod
=
0
elif
$(
which
insserv &> /dev/null
)
;
then
elif
$(
which
service &> /dev/null
)
;
then
service_mod
=
1
initd_mod
=
1
service_config_dir
=
"/etc/init.d"
elif
$(
which update-rc.d &> /dev/null
)
;
then
service_mod
=
1
initd_mod
=
2
service_config_dir
=
"/etc/init.d"
service_config_dir
=
"/etc/init.d"
if
$(
which chkconfig &> /dev/null
)
;
then
initd_mod
=
1
elif
$(
which insserv &> /dev/null
)
;
then
initd_mod
=
2
elif
$(
which update-rc.d &> /dev/null
)
;
then
initd_mod
=
3
else
service_mod
=
2
fi
else
service_mod
=
2
fi
# get the operating system type for using the corresponding init file
# ubuntu/debian(deb), centos/fedora(rpm), others: opensuse, redhat, ..., no verification
#osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
osinfo
=
$(
cat
/etc/os-release |
grep
"NAME"
|
cut
-d
'"'
-f2
)
#echo "osinfo: ${osinfo}"
os_type
=
0
if
echo
$osinfo
|
grep
-qwi
"ubuntu"
;
then
echo
"this is ubuntu system"
os_type
=
1
elif
echo
$osinfo
|
grep
-qwi
"debian"
;
then
echo
"this is debian system"
os_type
=
1
elif
echo
$osinfo
|
grep
-qwi
"Kylin"
;
then
echo
"this is Kylin system"
os_type
=
1
elif
echo
$osinfo
|
grep
-qwi
"centos"
;
then
echo
"this is centos system"
os_type
=
2
elif
echo
$osinfo
|
grep
-qwi
"fedora"
;
then
echo
"this is fedora system"
os_type
=
2
else
echo
"this is other linux system"
os_type
=
0
fi
function
kill_taosd
()
{
pid
=
$(
ps
-ef
|
grep
"taosd"
|
grep
-v
"grep"
|
awk
'{print $2}'
)
${
csudo
}
kill
-9
${
pid
}
||
:
if
[
-n
"
$pid
"
]
;
then
${
csudo
}
kill
-9
$pid
||
:
fi
}
function
install_main_path
()
{
...
...
@@ -153,20 +186,26 @@ function install_examples() {
}
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"
#${csudo} sed -i "\|${restart_config_str}|d" /etc/inittab || :
if
pidof taosd &> /dev/null
;
then
${
csudo
}
service taosd stop
||
:
fi
${
csudo
}
sed
-i
"
\|
${
restart_config_str
}
|d"
/etc/inittab
||
:
${
csudo
}
rm
-f
${
service_config_dir
}
/taosd
||
:
if
((
${
initd_mod
}
==
1
))
;
then
${
csudo
}
grep
-q
-F
"taos"
/etc/inittab
&&
${
csudo
}
insserv
-r
taosd
||
:
${
csudo
}
chkconfig
--del
taosd
||
:
elif
((
${
initd_mod
}
==
2
))
;
then
${
csudo
}
grep
-q
-F
"taos"
/etc/inittab
&&
${
csudo
}
update-rc.d
-f
taosd remove
||
:
${
csudo
}
insserv
-r
taosd
||
:
elif
((
${
initd_mod
}
==
3
))
;
then
${
csudo
}
update-rc.d
-f
taosd remove
||
:
fi
${
csudo
}
rm
-f
${
service_config_dir
}
/taosd
||
:
if
$(
which init &> /dev/null
)
;
then
${
csudo
}
init q
||
:
fi
# ${csudo} update-rc.d -f taosd remove || :
${
csudo
}
init q
||
:
}
function
install_service_on_sysvinit
()
{
...
...
@@ -175,19 +214,26 @@ function install_service_on_sysvinit() {
sleep
1
# Install taosd service
if
((
${
os_type
}
==
1
))
;
then
${
csudo
}
cp
-f
${
script_dir
}
/../deb/init.d/taosd
${
install_main_dir
}
/init.d
${
csudo
}
cp
${
script_dir
}
/../deb/init.d/taosd
${
service_config_dir
}
&&
${
csudo
}
chmod
a+x
${
service_config_dir
}
/taosd
restart_config_str
=
"taos:2345:respawn:
${
service_config_dir
}
/taosd start"
${
csudo
}
grep
-q
-F
"
$restart_config_str
"
/etc/inittab
||
${
csudo
}
bash
-c
"echo '
${
restart_config_str
}
' >> /etc/inittab"
# TODO: for centos, change here
elif
((
${
os_type
}
==
2
))
;
then
${
csudo
}
cp
-f
${
script_dir
}
/../rpm/init.d/taosd
${
install_main_dir
}
/init.d
${
csudo
}
cp
${
script_dir
}
/../rpm/init.d/taosd
${
service_config_dir
}
&&
${
csudo
}
chmod
a+x
${
service_config_dir
}
/taosd
fi
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
#${csudo} grep -q -F "$restart_config_str" /etc/inittab || ${csudo} bash -c "echo '${restart_config_str}' >> /etc/inittab"
if
((
${
initd_mod
}
==
1
))
;
then
${
csudo
}
insserv taosd
||
:
${
csudo
}
chkconfig
--add
taosd
||
:
${
csudo
}
chkconfig
--level
2345 taosd on
||
:
elif
((
${
initd_mod
}
==
2
))
;
then
${
csudo
}
insserv taosd
||
:
${
csudo
}
insserv
-d
taosd
||
:
elif
((
${
initd_mod
}
==
3
))
;
then
${
csudo
}
update-rc.d taosd defaults
||
:
fi
# ${csudo} update-rc.d taosd defaults
# chkconfig mysqld on
}
function
clean_service_on_systemd
()
{
...
...
@@ -237,7 +283,7 @@ function install_service() {
elif
((
${
service_mod
}
==
1
))
;
then
install_service_on_sysvinit
else
# must manual st
art
taosd
# must manual st
op
taosd
kill_taosd
fi
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录