diff options
author | Thilo Bangert <bangert@gentoo.org> | 2009-04-14 06:13:36 +0000 |
---|---|---|
committer | Thilo Bangert <bangert@gentoo.org> | 2009-04-14 06:13:36 +0000 |
commit | 80e3b659633872d36120d7d7d137a710e0e58ad1 (patch) | |
tree | 154cfdcf320b7917081786c82d59a75aa47b3c0f /sys-process/cronbase | |
parent | Marked ~hppa (bug #264108). (diff) | |
download | historical-80e3b659633872d36120d7d7d137a710e0e58ad1.tar.gz historical-80e3b659633872d36120d7d7d137a710e0e58ad1.tar.bz2 historical-80e3b659633872d36120d7d7d137a710e0e58ad1.zip |
ignore emacs backup files (bug #237200) - include logging patch (bug #140869)
Package-Manager: portage-2.1.6.7/cvs/Linux i686
Diffstat (limited to 'sys-process/cronbase')
-rw-r--r-- | sys-process/cronbase/ChangeLog | 11 | ||||
-rw-r--r-- | sys-process/cronbase/Manifest | 4 | ||||
-rw-r--r-- | sys-process/cronbase/cronbase-0.3.3.ebuild | 45 | ||||
-rwxr-xr-x | sys-process/cronbase/files/run-crons-0.3.3 | 110 |
4 files changed, 167 insertions, 3 deletions
diff --git a/sys-process/cronbase/ChangeLog b/sys-process/cronbase/ChangeLog index 23321720ae69..0dd4e56c4570 100644 --- a/sys-process/cronbase/ChangeLog +++ b/sys-process/cronbase/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-process/cronbase -# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/cronbase/ChangeLog,v 1.30 2008/10/12 07:28:59 bangert Exp $ +# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronbase/ChangeLog,v 1.31 2009/04/14 06:13:36 bangert Exp $ + +*cronbase-0.3.3 (13 Apr 2009) + + 13 Apr 2009; Thilo Bangert <bangert@gentoo.org> +files/run-crons-0.3.3, + +cronbase-0.3.3.ebuild: + ignore emacs backup files (bug #237200) - include logging patch (bug + #140869) 12 Oct 2008; Thilo Bangert <bangert@gentoo.org> -files/run-crons-0.2.1, -files/run-crons-0.3, -files/run-crons-0.3.1, -cronbase-0.2.1-r3.ebuild, diff --git a/sys-process/cronbase/Manifest b/sys-process/cronbase/Manifest index 180ea00f556a..744aac29a033 100644 --- a/sys-process/cronbase/Manifest +++ b/sys-process/cronbase/Manifest @@ -1,5 +1,7 @@ AUX run-crons-0.3.2 2982 RMD160 356b881d39f2ee4be23b688487044eee31c605ec SHA1 0bad7320dc22b4032541e9304a186700fd6edf2b SHA256 a9e6f0a4a73c582ce9417c57ab14545feddd83ac911c5e51c30de7237568f1e7 +AUX run-crons-0.3.3 3254 RMD160 3870cf294ba3ed30b118ee4ec748b36709c2abad SHA1 15ada91dceb17fd0b0a65bcaea3819b64f62000a SHA256 77aa0820f5827b7fa2c35f877c2dc617c85c0ac80c35002624be091da520141a EBUILD cronbase-0.3.2-r1.ebuild 1436 RMD160 88cda6e86dcbaa6271e38f815efffbbf818ec725 SHA1 a6cf0cc63d5a39f7d9d54313abecb3ca9236458f SHA256 368c195b7cbfc38203bfca6dce53b728aae15461ad006ad6ead9b42015aed5bb EBUILD cronbase-0.3.2.ebuild 878 RMD160 bf1b052e1916e01b96a92110d2dbe9a5230bf9d4 SHA1 d9a169b71b2a7b782e5b0b6f5fd2edd0395337da SHA256 0e979391efe9455c94b4d02889b2e7d436fcd4ca4aee32e4dcb469896b743e86 -MISC ChangeLog 7383 RMD160 6055d89e1fd0161c6b3eadbc1a8feb6a318043db SHA1 50efb0d41d332cb6d4ccf41b36ffbe217151f5ef SHA256 d67075481e68173e8c898033742f9ad298d3c77dd89c7167d4799ccb57dc5fb6 +EBUILD cronbase-0.3.3.ebuild 1397 RMD160 9ef4498115adcab73a59ea163b2066aefeb3417a SHA1 d0af790cae9a23fa601bf29bceb5b57f28a2bd08 SHA256 45468ba59a3d7b9071855df1e67867fd0af9e12c5e5fa10574d3d01028890324 +MISC ChangeLog 7597 RMD160 5f5a9a9afd599ba1683953474e4bfcb3d66c6f65 SHA1 d223fe05f420b97a89829abc7c115459662f6f54 SHA256 29d4072cac1de9c2a1ea1cfd3e8289fdaab30555cd0010f1a1248f51471d1395 MISC metadata.xml 158 RMD160 298878d8b5da225547b337739a1a48192546d7b8 SHA1 5a9f7a1c9f0f56d1b0e72ee9b67b5cc5771f6d7d SHA256 a262a73b2049a89ab6a4bdf51df27bea44c7f0aa0ee33176c59a9c63eb45e764 diff --git a/sys-process/cronbase/cronbase-0.3.3.ebuild b/sys-process/cronbase/cronbase-0.3.3.ebuild new file mode 100644 index 000000000000..965418985694 --- /dev/null +++ b/sys-process/cronbase/cronbase-0.3.3.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronbase/cronbase-0.3.3.ebuild,v 1.1 2009/04/14 06:13:36 bangert Exp $ + +inherit eutils + +DESCRIPTION="base for all cron ebuilds" +HOMEPAGE="http://www.gentoo.org/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="" + +pkg_setup() { + enewgroup cron 16 + enewuser cron 16 -1 /var/spool/cron cron +} + +src_install() { + newsbin "${FILESDIR}"/run-crons-${PV} run-crons || die + + diropts -m0750; keepdir /etc/cron.hourly + diropts -m0750; keepdir /etc/cron.daily + diropts -m0750; keepdir /etc/cron.weekly + diropts -m0750; keepdir /etc/cron.monthly + + diropts -m0750 -o root -g cron; keepdir /var/spool/cron + + diropts -m0750; keepdir /var/spool/cron/lastrun +} + +pkg_postinst() { + #Portage doesn't enforce proper permissions on already existing" + #directories (bug 141619). + echo + elog "Forcing proper permissions on" + elog "${ROOT}etc/cron.{hourly,daily,weekly,monthly}," + elog "${ROOT}var/spool/cron/ and ${ROOT}var/spool/cron/lastrun/" + echo + chmod 0750 "${ROOT}"etc/cron.{hourly,daily,weekly,monthly} \ + || die "chmod failed" + chmod 0750 "${ROOT}"var/spool/{cron,cron/lastrun} || die "chmod failed" + chown root:cron "${ROOT}var/spool/cron" || die "chown failed" +} diff --git a/sys-process/cronbase/files/run-crons-0.3.3 b/sys-process/cronbase/files/run-crons-0.3.3 new file mode 100755 index 000000000000..8b0116c91d3a --- /dev/null +++ b/sys-process/cronbase/files/run-crons-0.3.3 @@ -0,0 +1,110 @@ +#!/bin/bash +# +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronbase/files/run-crons-0.3.3,v 1.1 2009/04/14 06:13:36 bangert Exp $ +# +# 12 Oct 2008; Thilo Bangert <bangert@gentoo.org> run-crons: +# ignore emacs backup files (bug #237200) +# include logging patch (bug #140869) +# +# 08 Mar 2005; Aaron Walker <ka0ttic@gentoo.org> run-crons: +# Ignore the error messages from find caused by race conditions, since +# we could care less about the error as long as the file has been removed. +# See bug 8506. +# +# 06 May 2004; Aron Griffis <agriffis@gentoo.org> run-crons: +# Make the locking actually work. The old code was racy. +# Thanks to Mathias Gumz in bug 45155 for some cleanups. +# +# 23 Jun 2002; Jon Nelson <jnelson@gentoo.org> run-crons: +# fixed a race condition, where cron jobs and run-crons wanted to +# delete touch files +# +# 20 Apr 2002; Thilo Bangert <bangert@gentoo.org> run-crons: +# moved lastrun directory to /var/spool/cron/lastrun +# +# Author: Achim Gottinger <achim@gentoo.org> +# +# Mostly copied from SuSE +# +# this script looks into /etc/cron.[hourly|daily|weekly|monthly] +# for scripts to be executed. The info about last run is stored in +# /var/spool/cron/lastrun + +LOCKDIR=/var/spool/cron/lastrun +LOCKFILE=${LOCKDIR}/lock + +mkdir -p ${LOCKDIR} + +# Make sure we're not running multiple instances at once. +# Try twice to lock, otherwise give up. +for ((i = 0; i < 2; i = i + 1)); do + ln -sn $$ ${LOCKFILE} 2>/dev/null && break + + # lock failed, check for a running process. + # handle both old- and new-style locking. + cronpid=$(readlink ${LOCKFILE} 2>/dev/null) || + cronpid=$(cat ${LOCKFILE} 2>/dev/null) || + continue # lockfile disappeared? try again + + # better than kill -0 because we can verify that it's really + # another run-crons process + if [[ $(</proc/${cronpid}/cmdline) == $(</proc/$$/cmdline) ]] 2>/dev/null; then + # whoa, another process is really running + exit 0 + else + rm -f ${LOCKFILE} + fi +done + +# Check to make sure locking was successful +if [[ ! -L ${LOCKFILE} ]]; then + echo "Can't create or read existing ${LOCKFILE}, giving up" + exit 1 +fi + +# Set a trap to remove the lockfile when we're finished +trap "rm -f ${LOCKFILE}" 0 1 2 3 15 + + +for BASE in hourly daily weekly monthly ; do + CRONDIR=/etc/cron.${BASE} + + test -d $CRONDIR || continue + + if [ -e ${LOCKDIR}/cron.$BASE ] ; then + case $BASE in + hourly) + #>= 1 hour, 5 min -=> +65 min + TIME="-cmin +65" ;; + daily) + #>= 1 day, 5 min -=> +1445 min + TIME="-cmin +1445" ;; + weekly) + #>= 1 week, 5 min -=> +10085 min + TIME="-cmin +10085" ;; + monthly) + #>= 31 days, 5 min -=> +44645 min + TIME="-cmin +44645" ;; + esac + + find ${LOCKDIR} -name cron.$BASE $TIME -exec rm {} \; &>/dev/null || true + fi + + # if there is no touch file, make one then run the scripts + if [ ! -e ${LOCKDIR}/cron.$BASE ] ; then + touch ${LOCKDIR}/cron.$BASE + + set +e + GLOBIGNORE="*~" + for SCRIPT in $CRONDIR/* ; do + if [[ -x $SCRIPT && ! -d $SCRIPT ]]; then + [ -x /usr/bin/logger ] && /usr/bin/logger -i -p cron.info -t run-crons "(`whoami`) CMD ($SCRIPT)" + $SCRIPT + fi + done + fi +done + +# Clean out bogus cron.$BASE files with future times +touch ${LOCKDIR} +find ${LOCKDIR} -newer ${LOCKDIR} -exec /bin/rm -f {} \; &>/dev/null || true |