Bug 231203 - use ionice in /etc/cron.daily/mlocate
|
Bug#:
231203
|
Product: Gentoo Linux
|
Version: unspecified
|
Platform: All
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: enhancement
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: base-system@gentoo.org
|
Reported By: billie@gentoo.org
|
|
Component: Applications
|
|
|
URL:
|
|
Summary: use ionice in /etc/cron.daily/mlocate
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2008-07-08 17:44 0000
|
(In reply to comment #1)
> 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.
> 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
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.
> 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.
(In reply to comment #4)
> Created an attachment (id=164715) [edit] [details]
> updatedb.conf.diff
>
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'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,
_("unknown variable `%s'"), 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?
(In reply to comment #5)
> 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 am all for extra configuration file. If you prepare everything and test it
I happily commit it (bit short on time).
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.
Synced updatedb.conf, applied your patches (one typo though). Closing and
thanks.
(In reply to comment #11)
> Synced updatedb.conf, applied your patches (one typo though). Closing and
> thanks.
>
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=""
+ args=""
else
- args="-f proc"
+ args="-f proc"
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.
> (In reply to comment #11)
> > Synced updatedb.conf, applied your patches (one typo though). Closing and
> > thanks.
> >
>
> Which typo? Do you mean?
No, this one:
+ doins "${FILESDIR}/mlocate-cron.conf"
+ fperms 0644 /etc/mlocate.conf
Perms are not set on the right file.
(In reply to comment #12)
> 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.
There is no difference but I think the dot is really non-obvious and people
could miss to see it.
(In reply to comment #13)
>
> No, this one:
> + doins "${FILESDIR}/mlocate-cron.conf"
> + fperms 0644 /etc/mlocate.conf
>
> Perms are not set on the right file.
Aargh, copy-paste, thanks for spotting.
>
> There is no difference but I think the dot is really non-obvious and people
> could miss to see it.
>
Okay thanks for the clarification and for putting this into the tree.