summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klausmann <klausman@gentoo.org>2016-10-03 19:17:57 +0200
committerTobias Klausmann <klausman@gentoo.org>2016-10-03 19:19:08 +0200
commitd2d619f187661a12b4ed0dfed504fba057251f92 (patch)
tree776ae1f5b06e2b5140db0ded5f47ae27a89f51d6 /sys-process/cronbase/files
parentdev-ml/findlib: bump to 1.6.3 (diff)
downloadgentoo-d2d619f187661a12b4ed0dfed504fba057251f92.tar.gz
gentoo-d2d619f187661a12b4ed0dfed504fba057251f92.tar.bz2
gentoo-d2d619f187661a12b4ed0dfed504fba057251f92.zip
sys-process/cronbase: Fix the parall-job check once and for all.
Thanks to Dan Goodliffe for suggesting this approach. Gentoo-Bug: 595492
Diffstat (limited to 'sys-process/cronbase/files')
-rwxr-xr-xsys-process/cronbase/files/run-crons-0.3.76
1 files changed, 1 insertions, 5 deletions
diff --git a/sys-process/cronbase/files/run-crons-0.3.7 b/sys-process/cronbase/files/run-crons-0.3.7
index 958ef06c1ef7..902794e19e6f 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