!11 Ajust the order of operations
From: @bugflyfly Reviewed-by: @tian2020, @yukaii Signed-off-by: @yukaii
This commit is contained in:
commit
a8075d1340
@ -92,17 +92,10 @@ start_process() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# 如果有进程还在,暂停服务防止双进程存在
|
# 判断参数是否为空
|
||||||
if pgrep -x "samgr" > /dev/null; then
|
if [ -z "$1" ]; then
|
||||||
log info "service is running, stop it"
|
log error "Usage: $0 [all|samgr|huks|deviceauth|softbus|device_manager|dfs|datamgr]"
|
||||||
/system/bin/stop_services.sh all
|
exit 1
|
||||||
sleep 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 软链接动态库
|
|
||||||
if [ ! -e "/usr/lib64/libsec_shared.z.so" ]; then
|
|
||||||
log info "libsec_shared.z.so not exist, create it"
|
|
||||||
ln -s /usr/lib64/libboundscheck.so /usr/lib64/libsec_shared.z.so
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 新建日志目录
|
# 新建日志目录
|
||||||
@ -118,10 +111,10 @@ if [ ! -e "/etc/SN" ]; then
|
|||||||
echo "$ipv4_address" | sudo tee /etc/SN > /dev/null
|
echo "$ipv4_address" | sudo tee /etc/SN > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 判断参数是否为空
|
# 软链接动态库
|
||||||
if [ -z "$1" ]; then
|
if [ ! -e "/usr/lib64/libsec_shared.z.so" ]; then
|
||||||
log error "Usage: $0 [all|samgr|huks|deviceauth|softbus|device_manager|dfs|datamgr]"
|
log info "libsec_shared.z.so not exist, create it"
|
||||||
exit 1
|
ln -s /usr/lib64/libboundscheck.so /usr/lib64/libsec_shared.z.so
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 检查 $LD_LIBRARY_PATH 是否包含 "/system/lib64",如果不包含则加入
|
# 检查 $LD_LIBRARY_PATH 是否包含 "/system/lib64",如果不包含则加入
|
||||||
@ -155,6 +148,13 @@ if [ ! -e "/dev/binder" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd ${BIN_PATH} || exit
|
cd ${BIN_PATH} || exit
|
||||||
|
# 如果有进程还在,暂停服务防止双进程存在
|
||||||
|
if pgrep -x "samgr" > /dev/null; then
|
||||||
|
log info "service is running, stop it"
|
||||||
|
/system/bin/stop_services.sh all
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
|
||||||
# 验证参数并执行相应命令
|
# 验证参数并执行相应命令
|
||||||
if [ "$1" == "all" ]; then
|
if [ "$1" == "all" ]; then
|
||||||
log info "Starting all services..."
|
log info "Starting all services..."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user