1 |
commit: f97ae47b8a4dd7b4959a019adf148390e3a182cf |
2 |
Author: Tobias Klausmann <klausman <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 30 14:15:45 2016 +0000 |
4 |
Commit: Tobias Klausmann <klausman <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 30 14:17:45 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f97ae47b |
7 |
|
8 |
sys-process/cronbase: second attempt at fixing bug 595492 |
9 |
|
10 |
In the case of a stale lockfile, the old code still produces error |
11 |
messages: |
12 |
|
13 |
/usr/sbin/run-crons: line 61: /proc/6450/cmdline: No such file or |
14 |
directory |
15 |
|
16 |
This change should dodge that scenario. |
17 |
|
18 |
.../cronbase/{cronbase-0.3.7-r2.ebuild => cronbase-0.3.7-r3.ebuild} | 0 |
19 |
sys-process/cronbase/files/run-crons-0.3.7 | 2 +- |
20 |
2 files changed, 1 insertion(+), 1 deletion(-) |
21 |
|
22 |
diff --git a/sys-process/cronbase/cronbase-0.3.7-r2.ebuild b/sys-process/cronbase/cronbase-0.3.7-r3.ebuild |
23 |
similarity index 100% |
24 |
rename from sys-process/cronbase/cronbase-0.3.7-r2.ebuild |
25 |
rename to sys-process/cronbase/cronbase-0.3.7-r3.ebuild |
26 |
|
27 |
diff --git a/sys-process/cronbase/files/run-crons-0.3.7 b/sys-process/cronbase/files/run-crons-0.3.7 |
28 |
index c5f2d9c..ce8ff76 100755 |
29 |
--- a/sys-process/cronbase/files/run-crons-0.3.7 |
30 |
+++ b/sys-process/cronbase/files/run-crons-0.3.7 |
31 |
@@ -58,7 +58,7 @@ grab_lock() { |
32 |
# another run-crons process. |
33 |
# The tr call deletes null bytes so newer bash versions do not complain |
34 |
# about them. |
35 |
- cmdline1=$(tr -d '\0' < "/proc/${cronpid}/cmdline" 2>/dev/null) || : |
36 |
+ cmdline1=$([ -r "/proc/${cronpid}/cmdline" ] && tr -d '\0' < "/proc/${cronpid}/cmdline" 2>/dev/null) || : |
37 |
cmdline2=$(tr -d '\0' < /proc/$$/cmdline) |
38 |
if [ "${cmdline1}" = "${cmdline2}" ] ; then |
39 |
# Whoa, another run-crons is really running. |