<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>231203</bug_id>
          
          <creation_ts>2008-07-08 17:44 0000</creation_ts>
          <short_desc>use ionice in /etc/cron.daily/mlocate</short_desc>
          <delta_ts>2008-09-07 10:47:31 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>billie@gentoo.org</reporter>
          <assigned_to>base-system@gentoo.org</assigned_to>
          <cc>fauli@gentoo.org</cc>
    
    <cc>leio@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-07-08 17:44:49 0000</bug_when>
            <thetext>Sometimes when updatedb is running it is rather annoying because it sucks much disk I/O. So I thought it would be a good idea to use ionice in combination with nice for the cron script. I searched the net and found that the Ubuntu people already do this[1,2].

What do you think about this?

[1] https://bugs.launchpad.net/ubuntu/+source/findutils/+bug/134692
[2] http://launchpadlibrarian.net/9631597/slocate_3.1-1ubuntu2.dsc.diff</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-08-19 00:55:46 0000</bug_when>
            <thetext>rlocate doesnt really make sense ... it doesnt run a periodic cronjob

the Ubuntu patch has syntax errors (wonder if they realize it ...).  so ive implemented it myself for our slocate-3.1-r2.

http://sources.gentoo.org/sys-apps/slocate/files/slocate-3.1-cron2.patch?rev=1.1

just need to update mlocate ...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-08-19 06:59:44 0000</bug_when>
            <thetext>(In reply to comment #1)
&gt; rlocate doesnt really make sense ... it doesnt run a periodic cronjob

Oh, I did not know about this. I know mlocate and slocate use the cronjob so I was under the impression rlocate does this too.

&gt; the Ubuntu patch has syntax errors (wonder if they realize it ...).  so ive
&gt; implemented it myself for our slocate-3.1-r2.
&gt; http://sources.gentoo.org/sys-apps/slocate/files/slocate-3.1-cron2.patch?rev=1.1

Thanks for implementing this! Where are the syntax errors? I just saw your approach looks a bit cleaner as it saves one if statement for instance.

&gt; just need to update mlocate ...

What is the differnce in checking for /usr/bin/updatedb instead of /usr/bin/slocate. I guess that way it can be applied in a similar way for mlocate.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-06 12:46:18 0000</bug_when>
            <thetext>Created an attachment (id=164714)
mlocate.cron.diff

Patches for mlocate. They are done in the same way like slocate.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-06 12:46:42 0000</bug_when>
            <thetext>Created an attachment (id=164715)
updatedb.conf.diff

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-06 18:34:36 0000</bug_when>
            <thetext>(In reply to comment #4)
&gt; Created an attachment (id=164715) [edit]
&gt; updatedb.conf.diff
&gt; 

Okay it does not work the same way as slocate because updatedb from mlocate exits when it gets unknown options.

So possibilities are using an extra configuration file to set nice and ionice values for the cron job, hard coding the values in the cron file or patch mlocate so it does not exit when it gets unknown options.

I don&apos;t know if patching is difficult maybe it is just enough to remove

	case UCT_IDENTIFIER:
	  error_at_line (0, 0, UPDATEDB_CONF, uc_line,
			 _(&quot;unknown variable `%s&apos;&quot;), uc_lex_buf);
	  goto skip_to_eol;

from src/conf.c. Have not tested this yet.

I for now use the extra configuration file option.

Or are there probably other possibilities?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-09-06 19:38:57 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; So possibilities are using an extra configuration file to set nice and ionice
&gt; values for the cron job, hard coding the values in the cron file or patch
&gt; mlocate so it does not exit when it gets unknown options.

 I am all for extra configuration file.  If you prepare everything and test it I happily commit it (bit short on time).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-06 19:49:38 0000</bug_when>
            <thetext>Created an attachment (id=164751)
mlocate-0.21.ebuild.diff

patched ebuild to install extra configuration file</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-06 19:50:12 0000</bug_when>
            <thetext>Created an attachment (id=164753)
mlocate.cron.diff

changed cron file</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-06 19:51:06 0000</bug_when>
            <thetext>Created an attachment (id=164754)
mlocate-cron.conf

additional file to control nice and ionice in the mlocate cron job</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-06 19:53:27 0000</bug_when>
            <thetext>By the way, is it possible that the updatedb.conf for mlocate is from slocate. They look the same but are not completely the same. If possible they could be adjusted.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-09-07 02:11:47 0000</bug_when>
            <thetext>Synced updatedb.conf, applied your patches (one typo though).  Closing and thanks.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-07 06:31:24 0000</bug_when>
            <thetext>(In reply to comment #11)
&gt; Synced updatedb.conf, applied your patches (one typo though).  Closing and
&gt; thanks.
&gt; 

Which typo? Do you mean?

--- mlocate/mlocate.cron	2008-09-07 08:15:45.000000000 +0200
+++ mlocate-new/mlocate.cron	2008-09-07 08:16:42.000000000 +0200
@@ -4,14 +4,14 @@
 then
 	if [ -f /etc/updatedb.conf ]
 	then
-		args=&quot;&quot;
+	    args=&quot;&quot;
 	else
-		args=&quot;-f proc&quot;
+	    args=&quot;-f proc&quot;
 	fi
 
 	if [ -f /etc/mlocate-cron.conf ]
 	then
-		. /etc/mlocate-cron.conf
+		source /etc/mlocate-cron.conf
 	fi
 
 	# run on active process in case ionice isnt installed, or

So besides the different indention the only difference I see is the usage of (source config) vs (. config). I always thought it makes no difference which one is used. I took the dot as it was the same for slocate.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-09-07 08:31:16 0000</bug_when>
            <thetext>&gt; (In reply to comment #11)
&gt; &gt; Synced updatedb.conf, applied your patches (one typo though).  Closing and
&gt; &gt; thanks.
&gt; &gt; 
&gt; 
&gt; Which typo? Do you mean?

 No, this one:
+	doins &quot;${FILESDIR}/mlocate-cron.conf&quot;
+	fperms 0644 /etc/mlocate.conf

Perms are not set on the right file.

(In reply to comment #12)
&gt; So besides the different indention the only difference I see is the usage of
&gt; (source config) vs (. config). I always thought it makes no difference which
&gt; one is used. I took the dot as it was the same for slocate.

 There is no difference but I think the dot is really non-obvious and people could miss to see it.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>billie@gentoo.org</who>
            <bug_when>2008-09-07 10:47:31 0000</bug_when>
            <thetext>(In reply to comment #13)
&gt; 
&gt;  No, this one:
&gt; +       doins &quot;${FILESDIR}/mlocate-cron.conf&quot;
&gt; +       fperms 0644 /etc/mlocate.conf
&gt; 
&gt; Perms are not set on the right file.

Aargh, copy-paste, thanks for spotting.

&gt; 
&gt;  There is no difference but I think the dot is really non-obvious and people
&gt; could miss to see it.
&gt; 

Okay thanks for the clarification and for putting this into the tree.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>164714</attachid>
            <date>2008-09-06 12:46 0000</date>
            <desc>mlocate.cron.diff</desc>
            <filename>mlocate.cron.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIG1sb2NhdGUuY3JvbgkyMDA4LTA5LTA2IDEzOjU4OjMwLjAwMDAwMDAwMCArMDIwMAorKysg
bWxvY2F0ZS5jcm9uLm5ldwkyMDA4LTA5LTA2IDE0OjAyOjU4LjAwMDAwMDAwMCArMDIwMApAQCAt
NCw4ICs0LDE1IEBACiB0aGVuCiAJaWYgWyAtZiAvZXRjL3VwZGF0ZWRiLmNvbmYgXQogCXRoZW4K
LQkJbmljZSAvdXNyL2Jpbi91cGRhdGVkYgorCQkuIC9ldGMvdXBkYXRlZGIuY29uZgorCQlhcmdz
PSIiCiAJZWxzZQotCQluaWNlIC91c3IvYmluL3VwZGF0ZWRiIC1mIHByb2MKKwkJYXJncz0iLWYg
cHJvYyIKIAlmaQorCisJIyBydW4gb24gYWN0aXZlIHByb2Nlc3MgaW4gY2FzZSBpb25pY2UgaXNu
dCBpbnN0YWxsZWQsIG9yCisJIyBzeXN0ZW0gaXMgcmVhbGx5IG9sZCBhbmQgaW9uaWNlIGRvZXNu
dCB3b3JrIC4uLgorCWlvbmljZSAtYyAke0lPTklDRV9DTEFTUzotMn0gLW4gJHtJT05JQ0VfUFJJ
T1JJVFk6LTd9IC1wICQkIDI+L2Rldi9udWxsCisKKwluaWNlIC1uICR7TklDRTotMTB9IC91c3Iv
YmluL3VwZGF0ZWRiICR7YXJnc30KIGZpCg==
</data>        

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>164715</attachid>
            <date>2008-09-06 12:46 0000</date>
            <desc>updatedb.conf.diff</desc>
            <filename>updatedb.conf.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHVwZGF0ZWRiLmNvbmYJMjAwOC0wOS0wNiAxNDoxNzozNy4wMDAwMDAwMDAgKzAyMDAKKysr
IHVwZGF0ZWRiLmNvbmYtbmV3CTIwMDgtMDktMDYgMTQ6MTg6MjMuMDAwMDAwMDAwICswMjAwCkBA
IC0xMiwzICsxMiwxMiBAQAogCiAjIFNraXAgYmluZCBtb3VudHMuCiBQUlVORV9CSU5EX01PVU5U
Uz0ibm8iCisKKyMgbmljZSB2YWx1ZSB0byBydW4gYXQ6IHNlZSAtbiBpbiBuaWNlKDEpCitOSUNF
PSIxMCIKKworIyBpb25pY2UgY2xhc3MgdG8gcnVuIGF0OiBzZWUgLWMgaW4gaW9uaWNlKDEpCitJ
T05JQ0VfQ0xBU1M9IjIiCisKKyMgaW9uaWNlIHByaW9yaXR5IHRvIHJ1biBhdDogc2VlIC1uIGlu
IGlvbmljZSgxKQorSU9OSUNFX1BSSU9SSVRZPSI3Igo=
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>164751</attachid>
            <date>2008-09-06 19:49 0000</date>
            <desc>mlocate-0.21.ebuild.diff</desc>
            <filename>mlocate-0.21.ebuild.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIG1sb2NhdGUtMC4yMS5lYnVpbGQJMjAwOC0wOC0wOCAyMDozNzowMi4wMDAwMDAwMDAgKzAy
MDAKKysrIG1sb2NhdGUtMC4yMS5lYnVpbGQJMjAwOC0wOS0wNiAyMDoyOTo0OC4wMDAwMDAwMDAg
KzAyMDAKQEAgLTMzLDYgKzMzLDEwIEBACiAJZG9pbnMgIiR7RklMRVNESVJ9L3VwZGF0ZWRiLmNv
bmYiCiAJZnBlcm1zIDA2NDQgL2V0Yy91cGRhdGVkYi5jb25mCiAKKwlpbnNpbnRvIC9ldGMKKwlk
b2lucyAiJHtGSUxFU0RJUn0vbWxvY2F0ZS1jcm9uLmNvbmYiCisJZnBlcm1zIDA2NDQgL2V0Yy9t
bG9jYXRlLmNvbmYKKwogCWluc2ludG8gL2V0Yy9jcm9uLmRhaWx5CiAJbmV3aW5zICIke0ZJTEVT
RElSfS9tbG9jYXRlLmNyb24iIG1sb2NhdGUKIAlmcGVybXMgMDc1NSAvZXRjL2Nyb24uZGFpbHkv
bWxvY2F0ZQo=
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>164753</attachid>
            <date>2008-09-06 19:50 0000</date>
            <desc>mlocate.cron.diff</desc>
            <filename>mlocate.cron.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIG1sb2NhdGUuY3JvbgkyMDA3LTA3LTA4IDEyOjI2OjA5LjAwMDAwMDAwMCArMDIwMAorKysg
bWxvY2F0ZS5jcm9uCTIwMDgtMDktMDYgMjA6MzE6MjIuMDAwMDAwMDAwICswMjAwCkBAIC00LDgg
KzQsMTkgQEAKIHRoZW4KIAlpZiBbIC1mIC9ldGMvdXBkYXRlZGIuY29uZiBdCiAJdGhlbgotCQlu
aWNlIC91c3IvYmluL3VwZGF0ZWRiCisJCWFyZ3M9IiIKIAllbHNlCi0JCW5pY2UgL3Vzci9iaW4v
dXBkYXRlZGIgLWYgcHJvYworCQlhcmdzPSItZiBwcm9jIgogCWZpCisKKwlpZiBbIC1mIC9ldGMv
bWxvY2F0ZS1jcm9uLmNvbmYgXQorCXRoZW4KKwkJLiAvZXRjL21sb2NhdGUtY3Jvbi5jb25mCisJ
ZmkKKworCSMgcnVuIG9uIGFjdGl2ZSBwcm9jZXNzIGluIGNhc2UgaW9uaWNlIGlzbnQgaW5zdGFs
bGVkLCBvcgorCSMgc3lzdGVtIGlzIHJlYWxseSBvbGQgYW5kIGlvbmljZSBkb2VzbnQgd29yayAu
Li4KKwlpb25pY2UgLWMgJHtJT05JQ0VfQ0xBU1M6LTJ9IC1uICR7SU9OSUNFX1BSSU9SSVRZOi03
fSAtcCAkJCAyPi9kZXYvbnVsbAorCisJbmljZSAtbiAke05JQ0U6LTEwfSAvdXNyL2Jpbi91cGRh
dGVkYiAke2FyZ3N9CiBmaQo=
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>164754</attachid>
            <date>2008-09-06 19:51 0000</date>
            <desc>mlocate-cron.conf</desc>
            <filename>mlocate-cron.conf</filename>
            <type>text/plain</type>
            <data encoding="base64">IyBuaWNlIHZhbHVlIHRvIHJ1biBhdDogc2VlIC1uIGluIG5pY2UoMSkKTklDRT0iMTAiCgojIGlv
bmljZSBjbGFzcyB0byBydW4gYXQ6IHNlZSAtYyBpbiBpb25pY2UoMSkKSU9OSUNFX0NMQVNTPSIy
IgoKIyBpb25pY2UgcHJpb3JpdHkgdG8gcnVuIGF0OiBzZWUgLW4gaW4gaW9uaWNlKDEpCklPTklD
RV9QUklPUklUWT0iNyIK
</data>        

          </attachment>
    </bug>

</bugzilla>