Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 289884 - sys-apps/man-db doesn't install the package cron files
Summary: sys-apps/man-db doesn't install the package cron files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal with 2 votes (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 439876 (view as bug list)
Depends on:
Blocks: 284822
  Show dependency tree
 
Reported: 2009-10-20 16:16 UTC by C W Rose
Modified: 2016-05-21 11:45 UTC (History)
16 users (show)

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


Attachments
adjust permissions, provide cron script and cleanup (man-db.diff,1.21 KB, patch)
2010-06-08 21:40 UTC, Maciej Mrozowski
Details | Diff
man-db cron file (man-db,981 bytes, text/plain)
2010-06-14 07:21 UTC, C W Rose
Details
man-db diff (man-db-2.5.7.ebuild.diff,1.57 KB, patch)
2010-07-06 15:25 UTC, Maciej Mrozowski
Details | Diff
ebuild diff (man-db-2.5.7.ebuild.diff,1.46 KB, patch)
2010-07-06 16:10 UTC, Maciej Mrozowski
Details | Diff
man-db-2.6.0.2.ebuild.diff (man-db-2.6.0.2.ebuild.diff,2.37 KB, patch)
2011-06-15 22:28 UTC, Maciej Mrozowski
Details | Diff
berkdb compilation fix (for completeness sake) (man-db-2.6.0.2-berkdb-compilation-fix.patch,324 bytes, patch)
2011-06-15 22:29 UTC, Maciej Mrozowski
Details | Diff
man-db-2.6.0.2.ebuild.diff (man-db-2.6.0.2.ebuild.diff,2.39 KB, text/plain)
2011-11-04 21:58 UTC, Maciej Mrozowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description C W Rose 2009-10-20 16:16:15 UTC
The man-db package has a couple of useful cron files,
cron.daily and cron.weekly, which the ebuild doesn't
install.  This is inconvenient if you want man pages
regularly checked.

Reproducible: Always

Steps to Reproduce:
1. emerge man-db
2.
3.

Actual Results:  
See above

Expected Results:  
See above

See above
Comment 1 Matt 2010-05-27 20:28:38 UTC
any news on this ?

man-db is a pretty convenient replacement for man :)
Comment 2 SpanKY gentoo-dev 2010-05-27 22:10:09 UTC
i dont use man-db, so if someone posted a correctly working patch, i imagine i'd commit it a lot quicker
Comment 3 Maciej Mrozowski gentoo-dev 2010-06-08 21:40:13 UTC
Created attachment 234605 [details, diff]
adjust permissions, provide cron script and cleanup

Here it is:
- disable setuid in configure (enabled by default, it contains some code related to dropping privileges that doesn't really work like I would expect it to - it doesn't allow to generate global index unless I'm doing it wrong) and set setuid bits and cache directory permissions manually. Goal - to be able to update global index even when running as non-root (so typical user when doing 'man --update' or cron in case of 'mandb').
- disable threads explicitly (needs investigation whether it's safe for gdbm backend)
- provide simple cron.daily script to run mandb --quiet which generates index for 'whatis'

There's also option to use /var/cache/man-db instead of /var/cache/man as this directory is used by sys-apps/man as well and may contain incompatible and no longer neccessary cruft, like /var/cache/man/whatis. Other option is to purge this dir in pkg_preinst.
Comment 4 C W Rose 2010-06-14 07:21:45 UTC
Created attachment 235229 [details]
man-db cron file
Comment 5 Maciej Mrozowski gentoo-dev 2010-06-19 13:15:21 UTC
Yes, that cron script is from Debian, it won't work.

Also I don't think we really need to ensure all privileges are set there and we may even not have means if cron is running unprivileged.

I've installed cron script that does simply
#!/bin/sh
exec nice mandb --quiet

which is sufficient in this case (permissions are ensured in package pkg_postinst and nobody else is supposed to change them - if you break them, you're doing it wrong or you know what you're doing)

Mike, I'd like to move forward with this, what's your view on #3? Especially /var/cache/ man vs man-db directory issue.
Comment 6 SpanKY gentoo-dev 2010-06-20 01:07:20 UTC
what's this $TMPDIR junk ?  we have $T for that.  also, you use -EOF, but you dont actually indent the body with tabs.

`die` on `dodoc` is garbage; dont do it

i'd rather we figure out the set*id stuff and fix it upstream or fix our deployment rather than diverging in a manor no one will really be able to track back later
Comment 7 C W Rose 2010-06-28 08:58:56 UTC
(In reply to comment #5)
> Yes, that cron script is from Debian, it won't work.
> 

Works for me, and has for some time. Why do you think it fails?

Will


Comment 8 Maciej Mrozowski gentoo-dev 2010-07-06 15:25:44 UTC
Created attachment 237761 [details, diff]
man-db diff

- cleanup ebuild a bit
- enable-setuid (will prevent non-root users from regenerating cache, but it's apparently how it's supposed to be - at least it works like this in other distros)
- clean /var/cache/man if old sys-apps/man cruft is found there

@Mike
dodoc || die should stay imho, at least it delivers punishment for blind version bumps (of course you can do whatever you wish, it's your package after all)

@C W Rose
If you look closer debian cron file uses debian-specific calls like dpkg-statoverride. Also it uses start-stop-daemon for no apparent reason. Why do you insist?
Comment 9 Maciej Mrozowski gentoo-dev 2010-07-06 16:10:40 UTC
Created attachment 237765 [details, diff]
ebuild diff

Bummer, removed setting suid bits manually as buildsystem does it now.

I've also changed fperms 6755 /var/cache/man (suid+guid) (man:root)
to fperms 2755 /var/cache/man (guid) (man:root) to match debian

man and mandb executables are (as a factory setting) created wich chown man:root with just suid bit (4711)
Comment 10 SpanKY gentoo-dev 2010-07-06 18:38:12 UTC
i'm not adding die to dodoc, end of story.  stop wasting time on it.

you `rm -rf` the dir in pkg_preinst() and then turn around and try to `chown` it in pkg_postinst().  how can that possibly work ?

the inline script really should be intended:
    cat <<-EOF > foo
    ...
    EOF
Comment 11 Maciej Mrozowski gentoo-dev 2010-07-06 21:32:44 UTC
If you look closer there's keepdir /var/cache/man in src_install

chown + chmod could be probably added to cron script just before invoking mandb as well, but that's just in any case someone (un)intentionally broke permissions
Comment 12 SpanKY gentoo-dev 2010-07-06 22:07:46 UTC
that's a bit hokey/racey.  only delete sub-dirs/files.
Comment 13 C W Rose 2010-07-15 07:41:46 UTC
Interesting - missed the dpkg reference, but in fact
(with the file absent) the script works anyway.
I had assumed the "daemon" approach paid off with
lower resource usage/greater security, but I may well
be wrong.

Anyway, the script is good starting point, and (reference
the original comment) some sort of cron script is
definitely needed.

Will
Comment 14 Colin Watson 2010-11-28 18:09:54 UTC
The reason I used start-stop-daemon in the Debian cron.daily/cron.weekly scripts was to eliminate spurious syslog noise due to su opening a PAM session.  It's not critical to functionality.
Comment 15 Colin Watson 2010-11-28 18:13:35 UTC
Incidentally, as upstream I'm more than happy to help with any problems surrounding this.  I gather that this is one of the last blockers for using man-db by default in Gentoo, which I would love to see happen.
Comment 16 Maciej Mrozowski gentoo-dev 2011-06-15 22:28:12 UTC
Created attachment 277183 [details, diff]
man-db-2.6.0.2.ebuild.diff

> that's a bit hokey/racey.  only delete sub-dirs/files.

Fixed. Also now properly using autotools-utils.
Comment 17 Maciej Mrozowski gentoo-dev 2011-06-15 22:29:19 UTC
Created attachment 277185 [details, diff]
berkdb compilation fix (for completeness sake)
Comment 18 Colin Watson 2011-06-16 11:24:26 UTC
Thanks for reporting the build problem when configured to use Berkeley DB.  I have committed a more complete version of your fix upstream:

  http://bzr.savannah.gnu.org/lh/man-db/trunk/revision/1366

(Please forward such patches to me directly rather than relying on me happening to notice them in the Gentoo bug tracking system, though.)
Comment 19 Maciej Mrozowski gentoo-dev 2011-11-04 21:58:08 UTC
Created attachment 291697 [details]
man-db-2.6.0.2.ebuild.diff

Another revamp (adjust to new static libs handling in autotools-utils)
Comment 20 Maciej Mrozowski gentoo-dev 2011-11-27 22:04:03 UTC
Mike... maybe instead of rewriting the ebuild for no freakin' reason, you could use patch provided here...
Comment 21 Pacho Ramos gentoo-dev 2012-02-24 19:05:32 UTC
(In reply to comment #19)
> Created attachment 291697 [details]
> man-db-2.6.0.2.ebuild.diff
> 
> Another revamp (adjust to new static libs handling in autotools-utils)

Is this patch missing anything? If not, would be nice to commit it and get man-db replace man :)
Comment 22 Doug Goldstein (RETIRED) gentoo-dev 2012-07-23 18:49:58 UTC
(In reply to comment #19)
> Created attachment 291697 [details]
> man-db-2.6.0.2.ebuild.diff
> 
> Another revamp (adjust to new static libs handling in autotools-utils)

I'm confused by the depends. !berkdb? ( !gdbm? ( sys-lib/gdbm )) So when the user doesn't have either set, pull in gdbm?
Comment 23 Doug Goldstein (RETIRED) gentoo-dev 2012-07-23 18:59:24 UTC
(In reply to comment #19)
> Created attachment 291697 [details]
> man-db-2.6.0.2.ebuild.diff
> 
> Another revamp (adjust to new static libs handling in autotools-utils)

Last comment would be to use -EOF and intend the body of the script.
Comment 24 Doug Goldstein (RETIRED) gentoo-dev 2012-07-23 19:02:03 UTC
(In reply to comment #22)
> (In reply to comment #19)
> > Created attachment 291697 [details]
> > man-db-2.6.0.2.ebuild.diff
> > 
> > Another revamp (adjust to new static libs handling in autotools-utils)
> 
> I'm confused by the depends. !berkdb? ( !gdbm? ( sys-lib/gdbm )) So when the
> user doesn't have either set, pull in gdbm?

If this is the case I would rather bump the ebuild to EAPI 4 and solve it through REQUIRED_USE. Let me know if it is because I'll commit these changes along with the EAPI bump to the tree shortly.
Comment 25 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2012-07-23 22:53:59 UTC
(In reply to comment #24)
> (In reply to comment #22)
> > (In reply to comment #19)
> > > Created attachment 291697 [details]
> > > man-db-2.6.0.2.ebuild.diff
> > > 
> > > Another revamp (adjust to new static libs handling in autotools-utils)
> > 
> > I'm confused by the depends. !berkdb? ( !gdbm? ( sys-lib/gdbm )) So when the
> > user doesn't have either set, pull in gdbm?
> 
> If this is the case I would rather bump the ebuild to EAPI 4 and solve it
> through REQUIRED_USE. Let me know if it is because I'll commit these changes
> along with the EAPI bump to the tree shortly.

As long as man is pulled into system, don't use REQUIRED_USE and EAPI-4 or you'll break the stage building.

$ grep man $(portageq portdir)/profiles/base/packages 
*virtual/man
Comment 26 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-07-23 23:15:25 UTC
Make it a berkdb USE only and then

berkdb? ( sys-libs/db ) !berkdb? ( sys-libs/gdbm )
Comment 27 Pacho Ramos gentoo-dev 2012-07-24 07:18:39 UTC
As I commented yesterday to Cardoe in IRC, I think that we could drop gdbm USE flag and simply keep berkdb to not use gdbm only when berkdb is enabled
Comment 28 Pacho Ramos gentoo-dev 2012-09-16 11:21:11 UTC
(In reply to comment #27)
> As I commented yesterday to Cardoe in IRC, I think that we could drop gdbm
> USE flag and simply keep berkdb to not use gdbm only when berkdb is enabled

Will work on it and commit next week if nobody shows problems
Comment 29 Pacho Ramos gentoo-dev 2012-09-23 08:46:28 UTC
(In reply to comment #25)
> (In reply to comment #24)
> > (In reply to comment #22)
> > > (In reply to comment #19)
> > > > Created attachment 291697 [details]
> > > > man-db-2.6.0.2.ebuild.diff
> > > > 
> > > > Another revamp (adjust to new static libs handling in autotools-utils)
> > > 
> > > I'm confused by the depends. !berkdb? ( !gdbm? ( sys-lib/gdbm )) So when the
> > > user doesn't have either set, pull in gdbm?
> > 
> > If this is the case I would rather bump the ebuild to EAPI 4 and solve it
> > through REQUIRED_USE. Let me know if it is because I'll commit these changes
> > along with the EAPI bump to the tree shortly.
> 
> As long as man is pulled into system, don't use REQUIRED_USE and EAPI-4 or
> you'll break the stage building.
> 
> $ grep man $(portageq portdir)/profiles/base/packages 
> *virtual/man

I have seen all man-db versions in the tree use, at least, eapi2, I guess the new revbump should go back to eapi0? In that case it couldn't neither use autotools-utils.eclass as it needs >=eapi2
Comment 30 SpanKY gentoo-dev 2012-10-28 10:40:12 UTC
*** Bug 439876 has been marked as a duplicate of this bug. ***
Comment 31 SpanKY gentoo-dev 2012-10-28 11:09:27 UTC
should be all set now in the tree; thanks for the report!

Commit message: Install daily cronjob for building caches
http://sources.gentoo.org/sys-apps/man-db/files/man-db.cron?rev=1.1
http://sources.gentoo.org/sys-apps/man-db/man-db-2.6.3-r1.ebuild?rev=1.1