Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 93938 - Ebuild request: rlocate
Summary: Ebuild request: rlocate
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://rlocate.sourceforge.net/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-25 06:40 UTC by Christian Mandery
Modified: 2005-06-07 19:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
rlocate-0.3.0.ebuild (rlocate-0.3.0.ebuild,456 bytes, text/plain)
2005-05-25 18:34 UTC, SpanKY
Details
rlocate-0.3.0.ebuild (rlocate-0.3.0.ebuild,562 bytes, text/plain)
2005-05-26 20:18 UTC, SpanKY
Details
rlocated init script (rlocated,844 bytes, text/plain)
2005-05-30 16:55 UTC, Abraham Smith
Details
rlocate-0.3.0-r1.ebuild [EDIT 0.3.1-r1] (rlocate-0.3.0-r1.ebuild,1.35 KB, text/plain)
2005-06-06 12:01 UTC, Abraham Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Mandery 2005-05-25 06:40:06 UTC
"rlocate is an implementation of the ``locate'' command that is always 
up-to-date. The database that the original locate uses is usually updated only 
once a day, so newer files cannot be located right away. The behavior of 
rlocate is the same as slocate, but it also maintains a diff database that 
gets updated whenever a new file is created. This is accomplished with rlocate 
kernel module and daemon. The rlocate kernel module can be compiled only with 
Linux 2.6 kernels." 
(from the page) 
 
I think if you have a 2.6 kernel (which is now default with Gentoo Linux), it 
is better to have rlocate than the normal slocate because (1) the database is 
always up-to-date and (2) the "fast" update only needs a few seconds compared 
to many minutes for slocate's updatedb. 

Reproducible: Always
Steps to Reproduce:
1. emerge rlocate 
 
Actual Results:  
emerge: there are no ebuilds to satisfy "rlocate". 

Expected Results:  
>>> sys-apps/rlocate merged.
Comment 1 SpanKY gentoo-dev 2005-05-25 18:34:13 UTC
Created attachment 59839 [details]
rlocate-0.3.0.ebuild

try this ebuild out
Comment 2 Jeffrey 2005-05-26 02:55:25 UTC
Shouldn't it be using one of the module eclasses?

It should also block on slocate (in the final version), both install updatedb
and locate symlinks.

In addition, the module needs security support enabled in the kernel, which
isn't a very common option. configure will (or should) bomb out without.
I've also had problems building it against the kernel in /usr/src/linux instead
of the running kernel (the configure option appears to do nothing), so it has to
be rebuild after the reboot (breaking the new module-rebuild package) or with a
number of hacks.
Comment 3 Jeffrey 2005-05-26 03:29:37 UTC
Sorry for the bugspam, but I can't get the ebuild to work. Snippets from the
ebuild and a manual install:

make[2]: Entering directory
`/var/tmp/portage/rlocate-0.3.0/work/rlocate-0.3.0/rlocate-module'
mv Makefile Makefile.automake
cp ./Makefile.kernel ./Makefile
make -C /lib/modules/2.6.11-gentoo-r9/build SUBDIRS=`cd . && pwd`  modules \
        KBUILD_VERBOSE=1
make[3]: Entering directory `/usr/src/linux-2.6.11-gentoo-r9'
Makefile:531: /usr/src/linux-2.6.11-gentoo-r9/arch/x86/Makefile: No such file or
directory
make[3]: *** No rule to make target
`/usr/src/linux-2.6.11-gentoo-r9/arch/x86/Makefile'.  Stop.

This is related to ${ARCH} which is used by the kernel. Adding in a "econf;
unset ARCH; emake" src_compile function "works", but I highly doubt unsetting
ARCH is the best way to do this.

After that, it has a sandbox violation in the install part:
 /bin/install -c -m 644 rlocate.ko
/var/tmp/portage/rlocate-0.3.0/image//lib/modules/2.6.11-gentoo-r9/misc/rlocate.ko
/sbin/depmod -a
ACCESS DENIED   open_wr:   /lib/modules/2.6.11-gentoo-r9/modules.dep.temp
FATAL: Could not open /lib/modules/2.6.11-gentoo-r9/modules.dep.temp for
writing: Permission denied

After disabling the sandbox, it installs fine. But in order to actually keep the
DB up to date, rlocated has to be run, probably from a initscript.
Comment 4 SpanKY gentoo-dev 2005-05-26 20:18:07 UTC
Created attachment 59918 [details]
rlocate-0.3.0.ebuild

try this
Comment 5 Jeffrey 2005-05-27 02:51:32 UTC
Works fine after adding "inherit toolchain-funcs".
Comment 6 SpanKY gentoo-dev 2005-05-27 15:56:28 UTC
thanks, now in portage ~x86
Comment 7 Davide Rossi 2005-05-28 06:48:48 UTC
make[2]: Entering directory
`/var/tmp/portage/rlocate-0.3.0/work/rlocate-0.3.0/rlocate-scripts'
test -z "/usr/bin" || mkdir -p -- "/var/tmp/portage/rlocate-0.3.0/image//usr/bin"
 /bin/install -c 'rlocate-checkpoint'
'/var/tmp/portage/rlocate-0.3.0/image//usr/bin/rlocate-checkpoint'
make  install-exec-hook
make[3]: Entering directory
`/var/tmp/portage/rlocate-0.3.0/work/rlocate-0.3.0/rlocate-scripts'
/usr/sbin/groupadd `echo rlocate|sed 's,x,x,'`
ACCESS DENIED  open_wr:   /etc/group.27904
groupadd: impossibile fare il lock del file dei gruppi
make[3]: [install-exec-hook] Error 10 (ignored)
chown root:`echo rlocate|sed 's,x,x,'`
/var/tmp/portage/rlocate-0.3.0/image//usr/bin/rlocate-checkpoint
chown: `root:rlocate': gruppo non valido
make[3]: *** [install-exec-hook] Error 1
make[3]: Leaving directory
`/var/tmp/portage/rlocate-0.3.0/work/rlocate-0.3.0/rlocate-scripts'
make[2]: *** [install-exec-am] Error 2
make[2]: Leaving directory
`/var/tmp/portage/rlocate-0.3.0/work/rlocate-0.3.0/rlocate-scripts'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory
`/var/tmp/portage/rlocate-0.3.0/work/rlocate-0.3.0/rlocate-scripts'
make: *** [install-recursive] Error 1

!!! ERROR: sys-apps/rlocate-0.3.0 failed.
!!! Function src_install, Line 25, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/tmp/sandbox-sys-apps_-_rlocate-0.3.0-27756.log"

open_wr:   /etc/group.27904
--------------------------------------------------------------------------------



root@dappiu davide # emerge --info
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.4.3, glibc-2.3.5-r0,
2.6.11-cko3 i686)
=================================================================
System uname: 2.6.11-cko3 i686 AMD Athlon(tm) XP 2600+
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, May  5 2005, 09:36:16)]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.8
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.7.9-r1, 1.8.5-r3, 1.6.3, 1.9.4, 1.5
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.uni-c.dk/gentoo/ http://ftp.ntua.gr/pub/linux/gentoo/"
LANG="it_IT@euro"
LC_ALL="it_IT@euro"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s"
LINGUAS="it"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowex X aalib alsa apache2 apm arts audiofile avi
bash-completion berkdb bitmap-fonts cdr crypt cups curl directfb divx4linux dvd
dvdr dvdread emboss encode esd fam fbcon flac foomaticdb fortran ftp gd gdbm gif
gnome gphoto2 gpm gstreamer gtk gtk2 imagemagick imlib ipv6 jack java javascript
jpeg junit kde kdeenablefinal libg++ libwww mad mikmod mmx motif mozilla mp3
mpeg msn mysql nas ncurses nls odbc ogg oggvorbis opengl oss pam pdflib perl php
png postgres python qt quicktime readline scanner sdl slang spell ssl svga tcltk
tcpd tiff truetype truetype-fonts type1-fonts usb visualization vorbis xine xml2
xmms xv xvid zlib linguas_it userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET
Comment 8 SpanKY gentoo-dev 2005-05-28 14:40:41 UTC
deleted the call to groupadd ... sync up and see if that fixes things
Comment 9 Abraham Smith 2005-05-30 15:38:24 UTC
The problem is that no rlocate group exists.

I solved this by just changing slocate to rlocate in /etc/group, but a solution
should be put into the ebuild.
Comment 10 SpanKY gentoo-dev 2005-05-30 16:54:10 UTC
does rlocate need a rlocate group ?  if so, we should probably unify the
slocate/rlocate group handling into just a 'locate' group
Comment 11 Abraham Smith 2005-05-30 16:54:51 UTC
Also, we should provide a proper init script for the rlocated daemon (whihc
makes all this worthwhile...)

Here is a simple one I whipped up (note the header stolen from the gkrellm script)
Comment 12 Abraham Smith 2005-05-30 16:55:33 UTC
Created attachment 60223 [details]
rlocated init script
Comment 13 Abraham Smith 2005-05-30 16:59:18 UTC
(In reply to comment #10)
> does rlocate need a rlocate group ?  if so, we should probably unify the
> slocate/rlocate group handling into just a 'locate' group

Yes, it does.  That is a fine idea.

In case anything depends on slocate, we might eventually want a virtual
dependency, too.  Since rlocate is based on slocate's code and it meant to be
compatible, this should be reasonable.  

One more thing:  it may be good to check the kernel version.  Since gentoo has
all but abandoned 2.4, this may not be necessary, but the README of rlocate says 
"rlocate kernel module can be compiled only with 2.6.* kernels."
Comment 14 Abraham Smith 2005-05-30 17:16:10 UTC
Sorry for the rapid-fire comments, but two more things I've noted:
1) a version bump is needed, to 0.3.1.  This fixed a segfault in fast updatedb,
which I personally experienced on every attempt.
2) /var/lib/rlocate needs to be created in the ebuild.

I'll sit on my hands and let someone else play now...


Comment 15 SpanKY gentoo-dev 2005-05-31 15:45:23 UTC
ok, ive updated rlocate and slocate to use the 'locate' group
Comment 16 Abraham Smith 2005-06-06 12:01:15 UTC
Created attachment 60735 [details]
rlocate-0.3.0-r1.ebuild
[EDIT 0.3.1-r1]

You actually missed a couple chmods in the Makefiles, causing it to fail.  This
fixes that, and also installs the above initfile.
Comment 17 Abraham Smith 2005-06-06 12:10:27 UTC
I'm sorry, make that 0.3.1-r1. forgot the version bump.
Comment 18 Abraham Smith 2005-06-07 04:49:23 UTC
I've noted this error arising with the new "locate" group:

rlocated: WARNING: Could not find the group: rlocate in the /etc/group file.   
                                        
rlocated: WARNING: This is a result of the group missing or a corrupted group
file.  

so, I wonder if the rlocate group is hardcoded into the command somehow?  
Comment 19 Rasto Levrinc 2005-06-07 19:39:21 UTC
You should also modify RLOCATE_GRP=... in rlocate-daemon/Makefile.in
Comment 20 SpanKY gentoo-dev 2005-06-07 19:47:40 UTC
what a crappy build system

added sed's to cvs, thanks