diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-07-22 01:22:30 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-07-22 01:22:30 +0000 |
commit | aa7b5ef1e8a6626f0d2c677826f3a0aaa8a76dac (patch) | |
tree | fa789bf82d9a56fa6b861c648fc50c71f283dc1a /sys-process/cronbase | |
parent | Update EGIT_REPO_URI to github, fix README installation (thanks Fabian Kislat... (diff) | |
download | historical-aa7b5ef1e8a6626f0d2c677826f3a0aaa8a76dac.tar.gz historical-aa7b5ef1e8a6626f0d2c677826f3a0aaa8a76dac.tar.bz2 historical-aa7b5ef1e8a6626f0d2c677826f3a0aaa8a76dac.zip |
Change how we filter script names to ignore .* and *~ files #427212 by David Voge.
Package-Manager: portage-2.2.20/cvs/Linux x86_64
Manifest-Sign-Key: 0xD2E96200
Diffstat (limited to 'sys-process/cronbase')
-rw-r--r-- | sys-process/cronbase/ChangeLog | 9 | ||||
-rw-r--r-- | sys-process/cronbase/Manifest | 24 | ||||
-rw-r--r-- | sys-process/cronbase/cronbase-0.3.4.ebuild | 33 | ||||
-rwxr-xr-x | sys-process/cronbase/files/run-crons-0.3.4 | 114 |
4 files changed, 178 insertions, 2 deletions
diff --git a/sys-process/cronbase/ChangeLog b/sys-process/cronbase/ChangeLog index 8c59e08bac25..629102a7e889 100644 --- a/sys-process/cronbase/ChangeLog +++ b/sys-process/cronbase/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-process/cronbase # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/cronbase/ChangeLog,v 1.42 2015/04/14 22:02:17 mrueg Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronbase/ChangeLog,v 1.43 2015/07/22 01:22:28 vapier Exp $ + +*cronbase-0.3.4 (22 Jul 2015) + + 22 Jul 2015; Mike Frysinger <vapier@gentoo.org> +cronbase-0.3.4.ebuild, + +files/run-crons-0.3.4: + Change how we filter script names to ignore .* and *~ files #427212 by David + Voge. 14 Apr 2015; Manuel Rüger <mrueg@gentoo.org> -cronbase-0.3.2-r1.ebuild, -cronbase-0.3.2.ebuild, -files/run-crons-0.3.2: diff --git a/sys-process/cronbase/Manifest b/sys-process/cronbase/Manifest index 26a966d31881..44157e025b0e 100644 --- a/sys-process/cronbase/Manifest +++ b/sys-process/cronbase/Manifest @@ -1,4 +1,26 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + AUX run-crons-0.3.3 3254 SHA256 77aa0820f5827b7fa2c35f877c2dc617c85c0ac80c35002624be091da520141a SHA512 b9f1dce57cb10ae17135bef3d197d411d802feee6645fbd753a08d154a2ab51b08f883995f041be73fd5e9e8c1a3fad487fbb02a141dd6644c339468bfe6c81d WHIRLPOOL 74e31eed4ba85548f89e5a0fa1a6bfb1a47f5b1dad9e2e75c33d796e39216ff6b88ed4e29bbb5ff59f81dfe3aa72268081eb33a4008c440a43303dde3ad2425e +AUX run-crons-0.3.4 3350 SHA256 f9671f7f5d0b31f7936c25acdd4cf16ff9d48fc5c9ff87206da8e0ca98a4abba SHA512 79fdeaa3934f9d933d00904859e433d3030f85fecfd6c7d6c97ea6033b1f3a1904c015a41e1b735d28f0b6757cecb27fd34d233e1d159112872c3d6dddaa8654 WHIRLPOOL 00ccdb335ba822406a840f6b0aa9b9b12fafe05e3ea324b00f9605f1297df6b14cfd131962043ad3657bab2395da3864e7c773e2426e6cdd8e22d009330b14bd EBUILD cronbase-0.3.3.ebuild 1401 SHA256 a964082ffb1ec5b03fc534597dd916ed1e8259508a289010957adf1d8facf28a SHA512 c9d6fe9c66345625afef2fbac2d602fcaea7f54acef6e9c5713c43964e3c3f1af96d711e620cbc79b422b5d1157c1cf16e9faac8b43fea6e82ff376677d2c6a4 WHIRLPOOL d2f7abdfd53061e02bbaf6192088a4866d96fb931ba3335b8159974296a4f21ce910bb385818ec3d2d776d8e06b4874b022cd32ca9fae52b0e0dd446f5901339 -MISC ChangeLog 8968 SHA256 e56457e75039595233a793a6f1a6f286647b9b6b2d259eec78b79478da59ce74 SHA512 e33ab1343422cfc5b6e923cfe38433366973914ea65723ac6f0e324313c8c99dd94444b58ed3ce711de9273e6d018bbfd39c118dd572e3aaaadd7d054c440af1 WHIRLPOOL 0244e61890c3762a25d167343c477f7129e80ae7bf147931c09760f0917a6438a0fed4755f10f9e3eef310e6a5e9167d909405800026cc69ee0519462f95a2c8 +EBUILD cronbase-0.3.4.ebuild 803 SHA256 85445fdb90299c616fb34534cdce726a0a8dc612367470541b0215ded016db8d SHA512 a976aa24a4091a7c70cce219723108d9f0379a384059875b32a1f03af17dc464ae97dae51d17da952befde3f3b30d38f0c3d481c1c5debb1da4a4357dc6a6ed1 WHIRLPOOL 4ca6cb7f49e577152c9254fbcc6019db0b39673fd35ab14223b9fa34ae1e1da631be7e353dd6c0b33c971badadaf88ea3f736ab96fcaef933d18b1f42b01aaea +MISC ChangeLog 9188 SHA256 fcb9c26d1480464a6d4b868260f472aa4578dc60e0bc995a66f44343dc809367 SHA512 a0837ebcdeba1b34925ce75f79ccc01a878e015bbe95a3a0d44b983e919f32129e302dddb2c9ae1bba3bf09f2b0cf5be19427c3b72782c9901db4f2958341945 WHIRLPOOL eab762be4b44ac179d09f139a7ad789f15658ad7a3ce23e6f87d27c8e9a177284b109369680500eccba786828dfc078fe73a4a54b9bf79171e4805bc64b00631 MISC metadata.xml 158 SHA256 a262a73b2049a89ab6a4bdf51df27bea44c7f0aa0ee33176c59a9c63eb45e764 SHA512 0848ecc6b5e718ad001952843f69815fd8c3f50d126d3a2bbc48b86a9bfa21eab50fdb2eb11188362b8ead9db4cefb3719b53e0b76e4412a7a9a377a091e60bc WHIRLPOOL 3034b4ecfc87a8678ffab15dfc07af401c1b53660f7369b80a63b5c20300a3701068e87d7f6ff28ac1fd1c373051ce895e0316ecf7d9e91ad4eb627702b1ba02 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iQIbBAEBCAAGBQJVrvBVAAoJEPGu1DbS6WIAJPQP92jRI4jPZxTdep4I6N/1jacF +VcKnn4rD/xcGtdx43u7pXnQrFRCNUOJFGS2zKiRYfahuP4YjlufmqCjYlwbGOWx5 +v73TYih4eSqd/VG8NWORYzrOlYlJtY1hMRBooJaTGPXEvEaQC668OVYi7B6FXGlE +vGemgfTW8PsCuuHyPZW/QfZNrFCWb/ryjGEpXM/H5SEWfbzCKm+8qL6Wog3q1i27 +JWkDKBY04eYFKrpeVLv/MlAXEGSUM5J/3OPBgAnOMmk3DmVGAbuGxbOlTCDGONX/ +DtnKRxe5WxJj+5kxeN309WDxDtGUST0Of/pryoQE5OiDHjvUmor61KuFsNzlX9Mq +u2QXWLG1otjv4K44r2jYXR0k2tMD47FZT9Skq3K6FqU0Gyj+AYu9jkFtOKbNxtsY +IBsYJ206+7qK1Fg81Iit1uNI8BH4en4pV4PxzenXVSa7PbDyOtS86dbVnXF3weox +MsaGZPmzvAko1D9EkLLOkAeHFQhUceve1Knmwq7c5+DiT7+zYP/s8iTlXjh2P5nA +qCP5KQXGzZtNq/fGKIYsvQJSsVKV7/2nxAdQdyVjpyhzh4L46bbk8G9lMJm9lvHc +XbL0XOy8u0Vn0hqVIx8nKlDuOIkCSKJmaCUgs3RGpZ9RWf7c2LAme96AlSfS+71T +llPTBl92kDzIK6LGb0Q= +=A3Mr +-----END PGP SIGNATURE----- diff --git a/sys-process/cronbase/cronbase-0.3.4.ebuild b/sys-process/cronbase/cronbase-0.3.4.ebuild new file mode 100644 index 000000000000..b689ee68381b --- /dev/null +++ b/sys-process/cronbase/cronbase-0.3.4.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronbase/cronbase-0.3.4.ebuild,v 1.1 2015/07/22 01:22:28 vapier Exp $ + +EAPI="5" + +inherit user + +DESCRIPTION="base for all cron ebuilds" +HOMEPAGE="http://www.gentoo.org/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="" + +S=${WORKDIR} + +pkg_setup() { + enewgroup cron 16 + enewuser cron 16 -1 /var/spool/cron cron +} + +src_install() { + newsbin "${FILESDIR}"/run-crons-${PV} run-crons + + diropts -m0750 + keepdir /etc/cron.{hourly,daily,weekly,monthly} + + keepdir /var/spool/cron/lastrun + diropts -m0750 -o root -g cron + keepdir /var/spool/cron +} diff --git a/sys-process/cronbase/files/run-crons-0.3.4 b/sys-process/cronbase/files/run-crons-0.3.4 new file mode 100755 index 000000000000..2514667c0002 --- /dev/null +++ b/sys-process/cronbase/files/run-crons-0.3.4 @@ -0,0 +1,114 @@ +#!/bin/bash +# +# $Header: /var/cvsroot/gentoo-x86/sys-process/cronbase/files/run-crons-0.3.4,v 1.1 2015/07/22 01:22:28 vapier 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 + for SCRIPT in $CRONDIR/* ; do + if [[ -x $SCRIPT && ! -d $SCRIPT ]]; then + # Filter out files people do not expect to be executed. + case ${SCRIPT} in + .*|*~) continue ;; + esac + + [ -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 |