1 |
scarabeus 11/01/31 13:17:10 |
2 |
|
3 |
Modified: mlocate.cron-r2 |
4 |
Log: |
5 |
Fix premature removing of the lock file and parse the args more sanely when there is no config around. This fixes bug #353270. |
6 |
|
7 |
(Portage version: 2.2.0_alpha19/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.4 sys-apps/mlocate/files/mlocate.cron-r2 |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/mlocate/files/mlocate.cron-r2?rev=1.4&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/mlocate/files/mlocate.cron-r2?rev=1.4&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/mlocate/files/mlocate.cron-r2?r1=1.3&r2=1.4 |
15 |
|
16 |
Index: mlocate.cron-r2 |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/sys-apps/mlocate/files/mlocate.cron-r2,v |
19 |
retrieving revision 1.3 |
20 |
retrieving revision 1.4 |
21 |
diff -u -r1.3 -r1.4 |
22 |
--- mlocate.cron-r2 30 Jan 2011 13:16:50 -0000 1.3 |
23 |
+++ mlocate.cron-r2 31 Jan 2011 13:17:10 -0000 1.4 |
24 |
@@ -12,13 +12,13 @@ |
25 |
|
26 |
# check if we are already running (lockfile) |
27 |
LOCKFILE="/var/lock/mlocate.daily.lock" |
28 |
-trap "rm -f ${LOCKFILE}" EXIT |
29 |
if [ -e "${LOCKFILE}" ]; then |
30 |
echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb." |
31 |
exit 1 |
32 |
-else |
33 |
- touch "${LOCKFILE}" |
34 |
fi |
35 |
+touch "${LOCKFILE}" |
36 |
+# trap the lockfile only if we really run the updatedb |
37 |
+trap "rm -f ${LOCKFILE}" EXIT |
38 |
|
39 |
# source the user specified variables |
40 |
if [ -f /etc/mlocate-cron.conf ]; then |
41 |
@@ -26,10 +26,9 @@ |
42 |
fi |
43 |
|
44 |
# check the config file |
45 |
-ARGS="" |
46 |
+NODEVS="" |
47 |
if [ ! -f /etc/updatedb.conf ]; then |
48 |
- nodevs=$(< /proc/filesystems awk '$1 == "nodev" && $2 != "rootfs" { print $2 }') |
49 |
- ARGS="-f ${nodevs}" |
50 |
+ NODEVS=$(< /proc/filesystems awk '$1 == "nodev" && $2 != "rootfs" { print $2 }') |
51 |
fi |
52 |
|
53 |
# alter the priority of the updatedb process |
54 |
@@ -42,7 +41,7 @@ |
55 |
|
56 |
# run the updatedb if possible |
57 |
if [ -x /usr/bin/updatedb ]; then |
58 |
- /usr/bin/updatedb ${ARGS} |
59 |
+ /usr/bin/updatedb -f "${NODEVS}" |
60 |
else |
61 |
echo >&2 "Warning: \"/usr/bin/updatedb\" is not executable, unable to run updatedb." |
62 |
exit 0 |