Revision: 646 http://opencsw.svn.sourceforge.net/opencsw/?rev=646&view=rev Author: wahwah Date: 2012-12-29 13:05:03 +0000 (Sat, 29 Dec 2012) Log Message: ----------- opencsw-future-update: Allow only one instance
Modified Paths: -------------- buildfarm/bin/opencsw-future-update Modified: buildfarm/bin/opencsw-future-update =================================================================== --- buildfarm/bin/opencsw-future-update 2012-12-29 13:04:40 UTC (rev 645) +++ buildfarm/bin/opencsw-future-update 2012-12-29 13:05:03 UTC (rev 646) @@ -8,6 +8,16 @@ declare -r BASE_DIR=$(dirname $0) +readonly lockpath=/var/tmp/catalog-generation.lock + +if ! mkdir "${lockpath}"; then + echo "'${lockpath}' is locked, '$0' is exiting." + exit 1 +fi + +trap "rm -f \"${lockpath}\"/pid; rmdir \"${lockpath}\"; exit 0" 1 2 3 5 6 15 ERR +echo $$ > "${lockpath}/pid" + ${BASE_DIR}/sync-mirror ${BASE_DIR}/sync-checkpkg @@ -18,3 +28,6 @@ ${BASE_DIR}/send-catalog-update-notifications echo "$0 completed successfully" + +rm -f "${lockpath}/pid" +rmdir "${lockpath}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ devel mailing list devel@lists.opencsw.org https://lists.opencsw.org/mailman/listinfo/devel