[yadt] push by maximili...@gmail.com - adding retry logic for already running yadt-yum processes on 2013-03-25 11:42 GMT

1 view
Skip to first unread message

ya...@googlecode.com

unread,
Mar 25, 2013, 7:42:33 AM3/25/13
to yadt-...@googlegroups.com
Revision: 70a545f79179
Branch: default
Author: Maximilien Riehl <maximili...@gmail.com>
Date: Mon Mar 25 04:35:32 2013
Log: adding retry logic for already running yadt-yum processes
http://code.google.com/p/yadt/source/detail?r=70a545f79179

Modified:
/yadt-client/src/usr/bin/yadt-yum
/yadt-client/yadt-client.spec

=======================================
--- /yadt-client/src/usr/bin/yadt-yum Fri Mar 15 04:09:01 2013
+++ /yadt-client/src/usr/bin/yadt-yum Mon Mar 25 04:35:32 2013
@@ -12,6 +12,8 @@
LICENSE="Licensed under the GNU General Public License. See
http://www.gnu.org/licenses/gpl.html
or the included LICENSE file for the full text of the GPL license. "

+MAX_TRIES=59
+
#
# this script is either found in the PATH or was called with a relative or
full path,
# here we get both.
@@ -23,10 +25,14 @@
exit 1
fi

-# do not run if another instance is running. pidof -x will always report
at least $$
+# Retry if another instance is running. pidof -x will always report at
least $$
+for TRY in $(seq 0 $MAX_TRIES); do
+ [ $$ == "$(pidof -x "$ME")" ] && break
+ echo "This is try $TRY of $MAX_TRIES"
+ echo "Another yum process is already running, retrying..." >&2 &&
sleep 1
+done
if [ $$ != "$(pidof -x "$ME")" ] ; then
- echo "$ME is already running"
- exit 0
+ echo "Yum still running, giving up" >&2 && exit 1
fi

# (2013-03-06 Kay Vogelgesang) source in sysconfig - you can activate
YUMCACHE_CLEAN here
=======================================
--- /yadt-client/yadt-client.spec Fri Mar 8 05:40:52 2013
+++ /yadt-client/yadt-client.spec Mon Mar 25 04:35:32 2013
@@ -1,6 +1,6 @@
Summary: yadt client
Name: yadt-client
-Version: 1.50
+Version: 1.51
Release: 1
License: GPL
Vendor: Immobilien Scout GmbH
@@ -49,6 +49,9 @@


%changelog
+* Mon Mar 25 2013 Marcel Wolf <marce...@immobilienscout24.de>
+- add retry logic for already running yadt-yum processes
+
* Fri Mar 08 2013 Kay Vogelgesang <kay.vog...@immobilienscout24.de>
- add precompiled pyc/pyo files in files.lst for rhel5 rpm builds

Reply all
Reply to author
Forward
0 new messages