* [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/
@ 2015-08-19 21:49 Mike Frysinger
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2015-08-19 21:49 UTC (permalink / raw
To: gentoo-commits
commit: 710db44781655c192126ce09e53f03d2679042e2
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 19 21:48:47 2015 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Aug 19 21:49:45 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=710db447
sys-process/cronbase: fix lockdir path #557620
.../cronbase/{cronbase-0.3.7.ebuild => cronbase-0.3.7-r1.ebuild} | 0
sys-process/cronbase/files/run-crons-0.3.7 | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys-process/cronbase/cronbase-0.3.7.ebuild b/sys-process/cronbase/cronbase-0.3.7-r1.ebuild
similarity index 100%
rename from sys-process/cronbase/cronbase-0.3.7.ebuild
rename to sys-process/cronbase/cronbase-0.3.7-r1.ebuild
diff --git a/sys-process/cronbase/files/run-crons-0.3.7 b/sys-process/cronbase/files/run-crons-0.3.7
index 16fe0fa..c661c77 100755
--- a/sys-process/cronbase/files/run-crons-0.3.7
+++ b/sys-process/cronbase/files/run-crons-0.3.7
@@ -6,7 +6,7 @@
# for scripts to be executed. The info about last run is stored in
# /var/spool/cron/lastrun
-LOCKDIR="/var/run/lock"
+LOCKDIR="/var/lock"
CRONSPOOLDIR="/var/spool/cron"
LASTRUNDIR="${CRONSPOOLDIR}/lastrun"
# This is the legacy lockfile that we need to clean up.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/
@ 2016-03-15 2:33 Mike Frysinger
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2016-03-15 2:33 UTC (permalink / raw
To: gentoo-commits
commit: e679b9d14900dfe50a49342172d4397fbcbbb649
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 15 02:29:37 2016 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Mar 15 02:31:59 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e679b9d1
sys-process/cronbase: drop old <0.3.7 versions
sys-process/cronbase/cronbase-0.3.3.ebuild | 45 -----------
sys-process/cronbase/cronbase-0.3.4.ebuild | 33 --------
sys-process/cronbase/cronbase-0.3.5-r1.ebuild | 33 --------
sys-process/cronbase/cronbase-0.3.6.ebuild | 33 --------
sys-process/cronbase/files/run-crons-0.3.3 | 86 --------------------
sys-process/cronbase/files/run-crons-0.3.4 | 90 ---------------------
sys-process/cronbase/files/run-crons-0.3.5 | 106 -------------------------
sys-process/cronbase/files/run-crons-0.3.6 | 109 --------------------------
8 files changed, 535 deletions(-)
diff --git a/sys-process/cronbase/cronbase-0.3.3.ebuild b/sys-process/cronbase/cronbase-0.3.3.ebuild
deleted file mode 100644
index a1410bc..0000000
--- a/sys-process/cronbase/cronbase-0.3.3.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-inherit user
-
-DESCRIPTION="base for all cron ebuilds"
-HOMEPAGE="https://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=""
-
-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/cronbase-0.3.4.ebuild b/sys-process/cronbase/cronbase-0.3.4.ebuild
deleted file mode 100644
index 9e09a39..0000000
--- a/sys-process/cronbase/cronbase-0.3.4.ebuild
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit user
-
-DESCRIPTION="base for all cron ebuilds"
-HOMEPAGE="https://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/cronbase-0.3.5-r1.ebuild b/sys-process/cronbase/cronbase-0.3.5-r1.ebuild
deleted file mode 100644
index 9e09a39..0000000
--- a/sys-process/cronbase/cronbase-0.3.5-r1.ebuild
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit user
-
-DESCRIPTION="base for all cron ebuilds"
-HOMEPAGE="https://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/cronbase-0.3.6.ebuild b/sys-process/cronbase/cronbase-0.3.6.ebuild
deleted file mode 100644
index 9e09a39..0000000
--- a/sys-process/cronbase/cronbase-0.3.6.ebuild
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit user
-
-DESCRIPTION="base for all cron ebuilds"
-HOMEPAGE="https://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.3 b/sys-process/cronbase/files/run-crons-0.3.3
deleted file mode 100755
index 9b4898a..0000000
--- a/sys-process/cronbase/files/run-crons-0.3.3
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-#
-# 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
diff --git a/sys-process/cronbase/files/run-crons-0.3.4 b/sys-process/cronbase/files/run-crons-0.3.4
deleted file mode 100755
index 662bd02..0000000
--- a/sys-process/cronbase/files/run-crons-0.3.4
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-#
-# 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
diff --git a/sys-process/cronbase/files/run-crons-0.3.5 b/sys-process/cronbase/files/run-crons-0.3.5
deleted file mode 100755
index 18a6199..0000000
--- a/sys-process/cronbase/files/run-crons-0.3.5
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-#
-# 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
-
-# Usage: log <level> <args to logger>
-# Log a message via syslog.
-log() {
- local level=$1
- shift
- logger -i -p "cron.${level}" -t run-crons "$@"
-}
-
-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
-
-
-EXIT_STATUS=0
-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
-
- log info "($(whoami)) CMD (${SCRIPT})"
- $SCRIPT
- ret=$?
- if [ ${ret} -ne 0 ] ; then
- log err "CMD (${SCRIPT}) failed with exit status ${ret}"
- EXIT_STATUS=1
- fi
- 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
-
-exit ${EXIT_STATUS}
diff --git a/sys-process/cronbase/files/run-crons-0.3.6 b/sys-process/cronbase/files/run-crons-0.3.6
deleted file mode 100755
index d39777f..0000000
--- a/sys-process/cronbase/files/run-crons-0.3.6
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/sh
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-#
-# 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
-
-# Usage: log <level> <args to logger>
-# Log a message via syslog.
-log() {
- local level="$1"
- shift
- logger -i -p "cron.${level}" -t run-crons "$@"
-}
-
-mkdir -p ${LOCKDIR}
-
-# Make sure we're not running multiple instances at once.
-# Try twice to lock, otherwise give up.
-i=0
-while [ $(( i += 1 )) -le 2 ] ; 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
- cmdline1=$(cat /proc/${cronpid}/cmdline 2>/dev/null) || :
- cmdline2=$(cat /proc/$$/cmdline)
- if [ "${cmdline1}" = "${cmdline2}" ] ; 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}" EXIT HUP INT QUIT TERM
-
-
-EXIT_STATUS=0
-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 {} \; 2>/dev/null || :
- 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
-
- log info "($(whoami)) CMD (${SCRIPT})"
- $SCRIPT
- ret=$?
- if [ ${ret} -ne 0 ] ; then
- log err "CMD (${SCRIPT}) failed with exit status ${ret}"
- EXIT_STATUS=1
- fi
- fi
- done
- fi
-done
-
-# Clean out bogus cron.$BASE files with future times
-touch ${LOCKDIR}
-find ${LOCKDIR} -newer ${LOCKDIR} -exec /bin/rm -f {} \; 2>/dev/null || :
-
-exit ${EXIT_STATUS}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/
@ 2016-09-30 14:17 Tobias Klausmann
0 siblings, 0 replies; 5+ messages in thread
From: Tobias Klausmann @ 2016-09-30 14:17 UTC (permalink / raw
To: gentoo-commits
commit: f97ae47b8a4dd7b4959a019adf148390e3a182cf
Author: Tobias Klausmann <klausman <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 30 14:15:45 2016 +0000
Commit: Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Fri Sep 30 14:17:45 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f97ae47b
sys-process/cronbase: second attempt at fixing bug 595492
In the case of a stale lockfile, the old code still produces error
messages:
/usr/sbin/run-crons: line 61: /proc/6450/cmdline: No such file or
directory
This change should dodge that scenario.
.../cronbase/{cronbase-0.3.7-r2.ebuild => cronbase-0.3.7-r3.ebuild} | 0
sys-process/cronbase/files/run-crons-0.3.7 | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys-process/cronbase/cronbase-0.3.7-r2.ebuild b/sys-process/cronbase/cronbase-0.3.7-r3.ebuild
similarity index 100%
rename from sys-process/cronbase/cronbase-0.3.7-r2.ebuild
rename to sys-process/cronbase/cronbase-0.3.7-r3.ebuild
diff --git a/sys-process/cronbase/files/run-crons-0.3.7 b/sys-process/cronbase/files/run-crons-0.3.7
index c5f2d9c..ce8ff76 100755
--- a/sys-process/cronbase/files/run-crons-0.3.7
+++ b/sys-process/cronbase/files/run-crons-0.3.7
@@ -58,7 +58,7 @@ grab_lock() {
# another run-crons process.
# The tr call deletes null bytes so newer bash versions do not complain
# about them.
- cmdline1=$(tr -d '\0' < "/proc/${cronpid}/cmdline" 2>/dev/null) || :
+ cmdline1=$([ -r "/proc/${cronpid}/cmdline" ] && tr -d '\0' < "/proc/${cronpid}/cmdline" 2>/dev/null) || :
cmdline2=$(tr -d '\0' < /proc/$$/cmdline)
if [ "${cmdline1}" = "${cmdline2}" ] ; then
# Whoa, another run-crons is really running.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/
@ 2016-10-02 8:48 Tobias Klausmann
0 siblings, 0 replies; 5+ messages in thread
From: Tobias Klausmann @ 2016-10-02 8:48 UTC (permalink / raw
To: gentoo-commits
commit: 741f6b4ca936e4fc82c99145bb8ced457149d28e
Author: Tobias Klausmann <klausman <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 2 08:46:32 2016 +0000
Commit: Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Sun Oct 2 08:48:39 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=741f6b4c
sys-process/cronbase: More fixes
The tr approach is racy, even with the test -r before it. Since tr can't
be told to read from a file and we can't redirect the subshell's warning
message, switch to sed and a file argument, then redirect stderr of
that.
.../cronbase/{cronbase-0.3.7-r3.ebuild => cronbase-0.3.7-r4.ebuild} | 0
sys-process/cronbase/files/run-crons-0.3.7 | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys-process/cronbase/cronbase-0.3.7-r3.ebuild b/sys-process/cronbase/cronbase-0.3.7-r4.ebuild
similarity index 100%
rename from sys-process/cronbase/cronbase-0.3.7-r3.ebuild
rename to sys-process/cronbase/cronbase-0.3.7-r4.ebuild
diff --git a/sys-process/cronbase/files/run-crons-0.3.7 b/sys-process/cronbase/files/run-crons-0.3.7
index ce8ff76..958ef06 100755
--- a/sys-process/cronbase/files/run-crons-0.3.7
+++ b/sys-process/cronbase/files/run-crons-0.3.7
@@ -58,8 +58,8 @@ grab_lock() {
# another run-crons process.
# The tr call deletes null bytes so newer bash versions do not complain
# about them.
- cmdline1=$([ -r "/proc/${cronpid}/cmdline" ] && tr -d '\0' < "/proc/${cronpid}/cmdline" 2>/dev/null) || :
- cmdline2=$(tr -d '\0' < /proc/$$/cmdline)
+ cmdline1=$(sed -e 's/\0/ /g' "/proc/${cronpid}/cmdline" 2>/dev/null) || :
+ cmdline2=$(sed -e 's/\0/ /g' /proc/$$/cmdline)
if [ "${cmdline1}" = "${cmdline2}" ] ; then
# Whoa, another run-crons is really running.
return 1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/
@ 2016-10-03 17:19 Tobias Klausmann
0 siblings, 0 replies; 5+ messages in thread
From: Tobias Klausmann @ 2016-10-03 17:19 UTC (permalink / raw
To: gentoo-commits
commit: d2d619f187661a12b4ed0dfed504fba057251f92
Author: Tobias Klausmann <klausman <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 3 17:17:57 2016 +0000
Commit: Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Mon Oct 3 17:19:08 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2d619f1
sys-process/cronbase: Fix the parall-job check once and for all.
Thanks to Dan Goodliffe for suggesting this approach.
Gentoo-Bug: 595492
.../cronbase/{cronbase-0.3.7-r4.ebuild => cronbase-0.3.7-r5.ebuild} | 0
sys-process/cronbase/files/run-crons-0.3.7 | 6 +-----
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/sys-process/cronbase/cronbase-0.3.7-r4.ebuild b/sys-process/cronbase/cronbase-0.3.7-r5.ebuild
similarity index 100%
rename from sys-process/cronbase/cronbase-0.3.7-r4.ebuild
rename to sys-process/cronbase/cronbase-0.3.7-r5.ebuild
diff --git a/sys-process/cronbase/files/run-crons-0.3.7 b/sys-process/cronbase/files/run-crons-0.3.7
index 958ef06..902794e 100755
--- a/sys-process/cronbase/files/run-crons-0.3.7
+++ b/sys-process/cronbase/files/run-crons-0.3.7
@@ -56,11 +56,7 @@ grab_lock() {
# This is better than kill -0 because we can verify that it's really
# another run-crons process.
- # The tr call deletes null bytes so newer bash versions do not complain
- # about them.
- cmdline1=$(sed -e 's/\0/ /g' "/proc/${cronpid}/cmdline" 2>/dev/null) || :
- cmdline2=$(sed -e 's/\0/ /g' /proc/$$/cmdline)
- if [ "${cmdline1}" = "${cmdline2}" ] ; then
+ if diff -qs /proc/{${cronpid},$$}/cmdline > /dev/null 2>&1; then
# Whoa, another run-crons is really running.
return 1
fi
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-10-03 17:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-03 17:19 [gentoo-commits] repo/gentoo:master commit in: sys-process/cronbase/files/, sys-process/cronbase/ Tobias Klausmann
-- strict thread matches above, loose matches on Subject: below --
2016-10-02 8:48 Tobias Klausmann
2016-09-30 14:17 Tobias Klausmann
2016-03-15 2:33 Mike Frysinger
2015-08-19 21:49 Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox