[Bug 861955] New: mlocate does not respect prunepaths
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c0 Summary: mlocate does not respect prunepaths Classification: openSUSE Product: openSUSE 13.1 Version: Final Platform: x86-64 OS/Version: openSUSE 13.1 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: support@microtechniques.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20140129 Firefox/24.0 PaleMoon/24.3.1 The locate replacement - mlocate - nightly updatedb cron job (mlocate.cron) does not respect the prunepaths (UPDATEDB_PRUNEPATHS) set by sysconfig/locate. Reproducible: Always Steps to Reproduce: 1.install mlocate 2.wait for daily cron jobs to run 3.use the locate command and find the files that should have been excluded have not been. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c Christian Boltz <suse-beta@cboltz.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |suse-beta@cboltz.de AssignedTo|bnc-team-screening@forge.pr |tchvatal@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c1 --- Comment #1 from Tomáš Chvátal <tchvatal@suse.com> 2014-02-12 08:54:48 UTC --- Never seen the variable honestly. In the sysconfig/locate I don't have it and you should set it in /etc/updatedb.conf like this # I want to ingore all nfs mounts PRUNEFS="nfs" # I hate logs PRUNEPATHS="/var/log" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c2 --- Comment #2 from Don Hughes <support@microtechniques.com> 2014-02-12 17:36:45 UTC --- It has been in /etc/sysconfig/locate in all of the previous releases: ## Type: string ## Default: "/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /.snapshot" # # uptdatedb can skip directories for its database. The following parameter # says which ones. # UPDATEDB_PRUNEPATHS=".... my stuff this type of local configuration option is just the type of information that the /etc/sysconfig/... files were designed for. It seems a mistake to relocate some configuration information from sysconfig to updatedb.conf especially since mlocate.cron specifically sources /etc/sysconfig/locate: # source the user specified variables if [ -f /etc/sysconfig/locate ] ; then . /etc/sysconfig/locate fi -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c3 Tomáš Chvátal <tchvatal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ma@suse.com --- Comment #3 from Tomáš Chvátal <tchvatal@suse.com> 2014-03-14 08:04:00 UTC --- *** Bug 867981 has been marked as a duplicate of this bug. *** http://bugzilla.novell.com/show_bug.cgi?id=867981 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c4 --- Comment #4 from Tomáš Chvátal <tchvatal@suse.com> 2014-03-14 08:10:11 UTC --- I don't think we should fiddle with what is the upstream default in this case. We are actually not moving stuff from /etc/sysconfig/locate to updatedb.conf but simply adhering to what upstream uses instead of inventing our special way that applies only for SUSE. The current content of the sysconfig.locate: https://build.opensuse.org/package/view_file/server:search/mlocate/sysconfig... It quite clearly states that it should not be used for such variables and where to find them. What I could do is to source the sysconfig.locate in the updatedb.conf if the file is found and when the old findutils variables are found remap them and print out warning about deprecation? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c5 --- Comment #5 from Tomáš Chvátal <tchvatal@suse.com> 2014-03-14 08:30:02 UTC --- I updated the code in the server:search repository so please try generated package from here: https://build.opensuse.org/package/show/server:search/mlocate The code in question that should handle this: https://build.opensuse.org/package/rdiff/server:search/mlocate?linkrev=base&rev=27 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c Tomáš Chvátal <tchvatal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |support@microtechniques.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c6 --- Comment #6 from Don Hughes <support@microtechniques.com> 2014-03-14 13:27:04 UTC --- Your suggestion in #5 seems reasonable, but I do disagree with #4. One of the reasons that I use a distribution like SuSE is not because it just pulls together a bunch of disparate packages - something that I could do myself; or get from any other distribution - but because it gives them a common and consistent look-and-feel and operation; and that it gives me tools like yast and /etc/sysconfig to manage them so that I do not have to search through different directories and discover the appropriate syntax for files that I look at only once every couple of years. So, on the contrary, I do think that SuSE should fiddle with upstream defaults. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c8 Don Hughes <support@microtechniques.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|support@microtechniques.com | --- Comment #8 from Don Hughes <support@microtechniques.com> 2014-03-16 21:57:57 UTC --- I installed mlocate-0.26-33.1.x86_64.rpm and now get these errors: /usr/bin/updatedb:/etc/updatedb.conf:20: unknown variable `if' /usr/bin/updatedb:/etc/updatedb.conf:21: variable name expected /usr/bin/updatedb:/etc/updatedb.conf:22: unknown variable `if' /usr/bin/updatedb:/etc/updatedb.conf:23: variable `PRUNEFS' was already defined /usr/bin/updatedb:/etc/updatedb.conf:24: unknown variable `fi' /usr/bin/updatedb:/etc/updatedb.conf:25: unknown variable `if' /usr/bin/updatedb:/etc/updatedb.conf:26: variable `PRUNEPATHS' was already defined /usr/bin/updatedb:/etc/updatedb.conf:27: unknown variable `fi' /usr/bin/updatedb:/etc/updatedb.conf:28: unknown variable `fi' -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c9 --- Comment #9 from Tomáš Chvátal <tchvatal@suse.com> 2014-03-17 08:53:12 UTC --- Thanks a bunch for the testing. Seems the manpage says it is shell script config but only for some values of shell script... So alternative solution which is bit more unhappy: https://build.opensuse.org/package/rdiff/server:search/mlocate?linkrev=base&rev=29 also it is available in the same place like you fetch it last time so please let me know if this works for you. As I explained in the changelog now updatedb direct call will ignore your old settings but at least cron service will note and use them. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c10 --- Comment #10 from Bernhard Wiedemann <bwiedemann@suse.com> 2014-03-17 11:00:14 CET --- This is an autogenerated message for OBS integration: This bug (861955) was mentioned in https://build.opensuse.org/request/show/226368 Factory / mlocate -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c12 --- Comment #12 from Don Hughes <support@microtechniques.com> 2014-03-18 01:01:57 UTC --- I got an error on mlocate.cron on line 32 with too many arguments. I fixed that by adding quotes. Then when I ran it, it took the su branch which did not have the --add-prunepaths argument that had been added to the root branch. I added it. It ran, but ignored the parameters. The "--" end of commnand line flags was evidently intended for the su command, but was passed to the updatedb command. I removed the -- and put the -c argument in quotes. Here is my diff: ====================================================================== [-${UPDATEDB_PRUNEFS}-] {+"$UPDATEDB_PRUNEFS"+} ====================================================================== [-UPDATEDB_PRUNEFS="--add-prunefs ${UPDATEDB_PRUNEFS}"-] {+UPDATEDB_PRUNEFS="--add-prunefs=\"${UPDATEDB_PRUNEFS}\""+} ====================================================================== [-${UPDATEDB_PRUNEPATHS}-] {+"$UPDATEDB_PRUNEPATHS"+} ====================================================================== [-UPDATEDB_PRUNEPATHS="--add-prunepaths ${UPDATEDB_PRUNEPATHS}"-] {+UPDATEDB_PRUNEPATHS="--add-prunepaths=\"${UPDATEDB_PRUNEPATHS}\""+} ====================================================================== [-NODEVS=$(<-] {+NODEVS="-f "$(<+} ====================================================================== [-/usr/bin/updatedb -- -f "${NODEVS}"-] {+"/usr/bin/updatedb ${NODEVS} ${UPDATEDB_PRUNEFS} ${UPDATEDB_PRUNEPATHS}"+} ====================================================================== [--f "${NODEVS}" "${UPDATEDB_PRUNEFS}" "${UPDATEDB_PRUNEPATHS}"-] {+${NODEVS} ${UPDATEDB_PRUNEFS} ${UPDATEDB_PRUNEPATHS}+} ====================================================================== This works for me with my old /etc/sysconfig/locate config file. I did not test it with /etc/updatedb.conf changes I also created an alias for updatedb the passes the prunepaths argument. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c13 --- Comment #13 from Tomáš Chvátal <tchvatal@suse.com> 2014-03-19 09:13:04 UTC --- Thanks a lot for testing it. I incorporated your suggestions and submitted to Factory now. https://build.opensuse.org/request/show/226685 Also in future it is best way to attach the differences as attachment while using diff command like this: diff -urN file.old file.new -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c14 --- Comment #14 from Don Hughes <support@microtechniques.com> 2014-03-19 13:09:12 UTC --- Latest mlocate.cron works for me. Will make a note of the diff options. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c15 Tomáš Chvátal <tchvatal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #15 from Tomáš Chvátal <tchvatal@suse.com> 2014-03-21 14:36:59 UTC --- Thanks a lot for the testing. I also submited the package as update to 13.1 release so it should be released there at some point. Closing the bug as fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c16 --- Comment #16 from Bernhard Wiedemann <bwiedemann@suse.com> 2014-03-21 16:00:13 CET --- This is an autogenerated message for OBS integration: This bug (861955) was mentioned in https://build.opensuse.org/request/show/227002 13.1 / mlocate -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c17 --- Comment #17 from Swamp Workflow Management <swamp@suse.de> 2014-03-31 09:04:21 UTC --- openSUSE-RU-2014:0462-1: An update that has one recommended fix can now be installed. Category: recommended (low) Bug References: 861955 CVE References: Sources used: openSUSE 13.1 (src): mlocate-0.26-4.9.1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c18 Peter Münster <pmlists@free.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |pmlists@free.fr Resolution|FIXED | --- Comment #18 from Peter Münster <pmlists@free.fr> 2014-04-03 10:42:36 UTC --- mlocate-0.26-4.9.1 fails: "/usr/bin/updatedb: unexpected operand on command line" My settings: NODEVS = empty UPDATEDB_PRUNEFS = empty UPDATEDB_PRUNEPATHS = --add-prunepaths="/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /.snapshot" Peter -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c19 Tomáš Chvátal <tchvatal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED --- Comment #19 from Tomáš Chvátal <tchvatal@suse.com> 2014-04-03 10:53:37 UTC --- Sorry that is a bug in your configuration. You were supposed to state folders there only like in the default/example here: ## Type: string ## Default: "/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /.snapshot" # # uptdatedb can skip directories for its database. The following parameter # says which ones. # UPDATEDB_PRUNEPATHS="/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /.snapshots /var/run/media" So it is really wrong value you entered there so the app ough to fail. If you think otherwise feel free to open new bug as this feature/issue is fixed but causes another regression. But my opinion is that you simply have bad config value that is not expected to be there. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c20 Bruno Friedmann <bruno@ioda-net.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bruno@ioda-net.ch --- Comment #20 from Bruno Friedmann <bruno@ioda-net.ch> 2014-04-03 11:19:35 UTC --- After getting the last mlocate update ( didn't have any troubles before ) the cron job finish with non 0 exit code SCRIPT: mlocate.cron exited with RETURNCODE = 1. SCRIPT: output (stdout && stderr) follows /usr/bin/updatedb: unexpected operand on command line SCRIPT: mlocate.cron S | Name | Type | Version | Arch | Repository --+-------------------+---------+------------+--------+----------------- i | mlocate | package | 0.26-4.9.1 | x86_64 | update i | mlocate-debuginfo | package | 0.26-4.9.1 | x86_64 | debug-update-oss i | mlocate-lang | package | 0.26-4.9.1 | noarch | update /etc/sysconfig/locate RUN_UPDATEDB_AS="" RUN_UPDATEDB=yes UPDATEDB_NETPATHS="" UPDATEDB_PRUNEPATHS="/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /.snapshot" UPDATEDB_NETUSER="" UPDATEDB_PRUNEFS="" NICE="19" IONICE_CLASS="2" IONICE_PRIORITY="7" cat /etc/updatedb.conf # /etc/updatedb.conf: config file for mlocate # This file sets variables that are used by updatedb. # For more info, see the updatedb.conf(5) manpage. # Filesystems that are pruned from updatedb database PRUNEFS="afs anon_inodefs auto autofs bdev binfmt binfmt_misc cgroup cifs coda configfs cramfs cpuset debugfs devpts devtmps devfs devpts ecryptfs eventpollfs exofs futexfs ftpfs fuse fusectl gfs gfs2 hostfs hugetlbfs inotifyfs iso9660 jffs2 lustre misc mqueue ncpfs nfs NFS nfs4 nfsd nnpfs ocfs ocfs2 pipefs proc ramfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs spufs sshfs subfs supermount sysfs tmpfs ubifs udf usbfs vboxsf vperfctrfs" # Paths which are pruned from updatedb database PRUNEPATHS="/tmp /var/tmp /var/cache /var/lock /var/run /var/spool /mnt /cdrom /usr/tmp /proc /media /sys /.snapshots /var/run/media" # Folder names that are pruned from updatedb database PRUNENAMES=".git .hg .svn CVS" # Skip bind mounts. PRUNE_BIND_MOUNTS="yes" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c21 Tomáš Chvátal <tchvatal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #21 from Tomáš Chvátal <tchvatal@suse.com> 2014-04-03 11:21:18 UTC --- As discussed on irc it seems the problem really is there. For time being just set RUN_UPDATEDB_AS="root" as it seems to have issue with the unset variable. Will sent update later on again :) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c22 --- Comment #22 from Peter Münster <pmlists@free.fr> 2014-04-03 11:36:51 UTC --- (In reply to comment #19)
Sorry that is a bug in your configuration.
No, I've a default configuration. Sorry, my text was not clear enough... These are the settings of the variables NODEVS, UPDATEDB_PRUNEFS and UPDATEDB_PRUNEPATHS in file /etc/cron.daily/mlocate.cron on line 66, just before the call to updatedb: NODEVS = empty UPDATEDB_PRUNEFS = empty UPDATEDB_PRUNEPATHS = --add-prunepaths="/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media /sys /.snapshot" HTH, Peter -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c23 --- Comment #23 from Peter Münster <pmlists@free.fr> 2014-04-03 11:41:07 UTC --- The problem is with quoted empty variables: FOO="" updatedb "$FOO" other-options -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c24 Tomáš Chvátal <tchvatal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED --- Comment #24 from Tomáš Chvátal <tchvatal@suse.com> 2014-04-03 11:42:38 UTC --- Yeah in that case your setup is indeed correct. Even better I updated the package in repo: https://build.opensuse.org/package/show/server:search/mlocate So when the trucks are again displayed in the buildstates you can update to it. I created submissions to Factory and 13.1 so it will be again updated at some point in future. As a workaround set the RUN_UPDATEDB_AS to root as I said above or use package from the above repository in meantime. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c25 Peter Münster <pmlists@free.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #25 from Peter Münster <pmlists@free.fr> 2014-04-15 09:45:37 UTC --- mlocate-0.26-4.13.1.x86_64 fails. Did you test it? Please try this: # export UPDATEDB_PRUNEPATHS='"--add-prunepaths="/mnt /cdrom /tmp"' # updatedb ${UPDATEDB_PRUNEPATHS} You'll get this error: "updatedb: unexpected operand on command line" Now try this: # updatedb "${UPDATEDB_PRUNEPATHS}" It works. Peter -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c26 --- Comment #26 from Peter Münster <pmlists@free.fr> 2014-04-15 09:55:20 UTC --- Why not just like this: # run the updatedb if possible if [ -x /usr/bin/updatedb ]; then if [ -n "${RUN_UPDATEDB_AS}" ] ; then RUN_UPDATEDB_AS=root fi # change the perms to the var directory to our desired user chown -R "${RUN_UPDATEDB_AS}":root /var/lib/mlocate # change the user and run the updatedb under it /usr/bin/su "${RUN_UPDATEDB_AS}" -c "/usr/bin/updatedb ${NODEVS} ${UPDATEDB_PRUNEFS} ${UPDATEDB_PRUNEPATHS}" else echo >&2 "Warning: \"/usr/bin/updatedb\" is not executable, unable to run updatedb." exit 0 fi Peter -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c27 --- Comment #27 from Peter Münster <pmlists@free.fr> 2014-04-15 09:56:39 UTC --- Sorry, rather like this: if [ -z "${RUN_UPDATEDB_AS}" ] ; then Peter -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=861955 https://bugzilla.novell.com/show_bug.cgi?id=861955#c28 Tomáš Chvátal <tchvatal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED --- Comment #28 from Tomáš Chvátal <tchvatal@suse.com> 2014-04-15 10:02:54 UTC --- Hehe, true I didn't try the other case with the enabled vars again. And used the same solution you suggest :) ------------------------------------------------------------------- Tue Apr 15 09:52:00 UTC 2014 - tchvatal@suse.com - Update once more to always hit the same code and to avoid regressions that are hit only under some setup scenarios. Index: mlocate.cron =================================================================== --- mlocate.cron (revision 34) +++ mlocate.cron (working copy) @@ -56,15 +56,13 @@ # run the updatedb if possible if [ -x /usr/bin/updatedb ]; then - if [ -n "${RUN_UPDATEDB_AS}" ] ; then - # change the perms to the var directory to our desired user - chown -R "${RUN_UPDATEDB_AS}":root /var/lib/mlocate - # change the user and run the updatedb under it - /usr/bin/su "${RUN_UPDATEDB_AS}" -c "/usr/bin/updatedb ${NODEVS} ${UPDATEDB_PRUNEFS} ${UPDATEDB_PRUNEPATHS}" - else - # just run it as root - /usr/bin/updatedb ${NODEVS} ${UPDATEDB_PRUNEFS} ${UPDATEDB_PRUNEPATHS} + if [ -z "${RUN_UPDATEDB_AS}" ] ; then + RUN_UPDATEDB_AS=root fi + # change the perms to the var directory to our desired user + chown -R "${RUN_UPDATEDB_AS}":root /var/lib/mlocate + # change the user and run the updatedb under it + /usr/bin/su "${RUN_UPDATEDB_AS}" -c "/usr/bin/updatedb ${NODEVS} ${UPDATEDB_PRUNEFS} ${UPDATEDB_PRUNEPATHS}" else echo >&2 "Warning: \"/usr/bin/updatedb\" is not executable, unable to run updatedb." exit 0 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com