Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-deploy-utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-deploy-utils
Commits
c7081cf0
Commit
c7081cf0
authored
Oct 16, 2017
by
qa_quantgroup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
减少并发数,更新排它锁
parent
8a8fbbfd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
sub_shell.sh
qa_shell_script/sub_shell.sh
+5
-4
No files found.
qa_shell_script/sub_shell.sh
View file @
c7081cf0
...
@@ -4,11 +4,12 @@ scriptname=$(basename $0)
...
@@ -4,11 +4,12 @@ scriptname=$(basename $0)
lock
=
"/var/run/
${
scriptname
}
"
lock
=
"/var/run/
${
scriptname
}
"
exec
200>
$lock
exec
200>
$lock
#flock -n 200 ||
echo "sub.sh 正在被其他人执行,请稍后再试" && exit 1
#flock -n 200 ||
{echo "sub.sh 正在被其他人执行,请稍后再试" && exit 1}
#flock -n 200 || exit 1
#flock -n 200 || exit 1
flock
-n
200
flock
-n
200
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"
$scriptname
正在被其他人执行,预计一分钟,请稍后再试~"
_p
=
`
ps aux |
grep
$scriptname
|
grep
-v
grep
|
head
-n
1 |awk
'{print $2}'
`
echo
"
$scriptname
正在被其他人执行,进程号:
$_p
,预计时间一分钟,请稍后再试~"
exit
1
exit
1
fi
fi
...
@@ -32,13 +33,13 @@ mkfifo /tmp/$tempfifo
...
@@ -32,13 +33,13 @@ mkfifo /tmp/$tempfifo
exec
1000<
>
/tmp/
$tempfifo
exec
1000<
>
/tmp/
$tempfifo
rm
-rf
/tmp/
$tempfifo
rm
-rf
/tmp/
$tempfifo
for
((
i
=
1
;
i<
=
6
;
i++
))
for
((
i
=
1
;
i<
=
3
;
i++
))
do
do
echo
>
&1000
echo
>
&1000
done
done
echo
"共要生成
$counts
个环境的配置文件"
echo
"共要生成
$counts
个环境的配置文件"
echo
"并发生成
6个环境的配置文,负载最大时为4
~"
echo
"并发生成
3个环境的配置文件,负载最大时为3
~"
#for ip_last_num in '15'
#for ip_last_num in '15'
for
ip_last_num
in
${
ips
[@]
}
for
ip_last_num
in
${
ips
[@]
}
do
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment