File tree Expand file tree Collapse file tree
patches/systemvm/debian/config/root Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ getLockFile() {
2424 return
2525 fi
2626
27- touch $__LOCKFILE
27+ psline=` ps u $$ `
28+ echo $psline > $__LOCKFILE
2829
2930 for i in ` seq 1 $(( $__TIMEOUT * 10 )) `
3031 do
@@ -43,8 +44,11 @@ getLockFile() {
4344 if [ $__locked -ne 1 ]
4445 then
4546 logger -t cloud " fail to acquire the lock $1 for process $0 pid $$ after $__TIMEOUT seconds time out!"
47+ cmd=` cat $currlock `
48+ logger -t cloud " waiting for command: $cmd "
4649 psline=` ps u $$ `
4750 logger -t cloud " Failed job detail: $psline "
51+ rm $__LOCKFILE
4852 fi
4953 echo $__locked
5054}
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ grep "redundant_router=1" /var/cache/cloud/cmdline > /dev/null
260260if [ $? -eq 0 ]
261261then
262262 is_redundant=1
263- sudo /root/checkrouter.sh| grep " Status: MASTER" > /dev/null 2>&1
263+ sudo /root/checkrouter.sh --no-lock | grep " Status: MASTER" > /dev/null 2>&1
264264 if [ $? -eq 0 ]
265265 then
266266 is_master=1
Original file line number Diff line number Diff line change 22
33source /root/func.sh
44
5- lock=" biglock"
6- locked=$( getLockFile $lock )
7- if [ " $locked " != " 1" ]
5+ nolock=0
6+ if [ $# -eq 1 ]
87then
9- exit 1
8+ if [ $1 == " --no-lock" ]
9+ then
10+ nolock=1
11+ fi
12+ fi
13+
14+ if [ $nolock -eq 0 ]
15+ then
16+ lock=" biglock"
17+ locked=$( getLockFile $lock )
18+ if [ " $locked " != " 1" ]
19+ then
20+ exit 1
21+ fi
1022fi
1123
1224bumped=" Bumped: NO"
2133 echo " $stat &$bumped "
2234fi
2335
24- unlock_exit $? $lock $locked
36+ if [ $nolock -eq 0 ]
37+ then
38+ unlock_exit $? $lock $locked
39+ fi
You can’t perform that action at this time.
0 commit comments