Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 832182 - sys-apps/man-db-2.9.4-r1: /etc/cron.daily/man-db uses su which is not installed
Summary: sys-apps/man-db-2.9.4-r1: /etc/cron.daily/man-db uses su which is not installed
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-28 08:33 UTC by Jaak Ristioja
Modified: 2022-02-07 07:32 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaak Ristioja 2022-01-28 08:33:53 UTC
/etc/cron.daily/man-db ends with the line

  exec su man -s /bin/sh -c 'nice mandb --quiet' 2>/dev/null

However, on this system there is no "su" installed due to sys-apps/util-linux[-su] and sys-apps/shadow[-su], and hence it fails with the following log message:

  run-parts: /etc/cron.daily/man-db exited with return code 127
Comment 1 Mike Gilbert gentoo-dev 2022-01-28 16:56:12 UTC
This is technically an optional runtime dependency. If you don't use the cron job, you don't need 'su'.

Given that most users will have 'su' installed by default, I don't really think we need to do anything here.
Comment 2 Jaak Ristioja 2022-01-29 10:30:19 UTC
(In reply to Mike Gilbert from comment #1)
> This is technically an optional runtime dependency. If you don't use the
> cron job, you don't need 'su'.

Yes, but as far as I can tell, man-db seems to enable this by default. At least I can't currently remember opting in, nor having seen any notice about this being optional. Either way, this causes a daily error message in the logs.

What is the official suggested way to disable this cronjob and prevent these errors in the logs?

> Given that most users will have 'su' installed by default, I don't really
> think we need to do anything here.

Although I might only represent the small minority of Gentoo users, I'm pleading You to take my case into account.

For this to be truly optional, I propose adding a "cron" USE-flag (enabled by default) to install /etc/cron.daily/man-db and pull in the proper runtime dependencies.

Thanks! :)
Comment 3 Mike Gilbert gentoo-dev 2022-02-07 02:50:46 UTC
(In reply to Jaak Ristioja from comment #2)
> What is the official suggested way to disable this cronjob and prevent these
> errors in the logs?

chmod -x /etc/cron.daily/man-db

> For this to be truly optional, I propose adding a "cron" USE-flag (enabled
> by default) to install /etc/cron.daily/man-db and pull in the proper runtime
> dependencies.

That would violate Gentoo policy, and I don't see a strong reason to do so.

https://projects.gentoo.org/qa/policy-guide/dependencies.html#pg0001
Comment 4 Jaak Ristioja 2022-02-07 07:32:46 UTC
(In reply to Mike Gilbert from comment #3)
> That would violate Gentoo policy, and I don't see a strong reason to do so.

Interesting policy. Given there were no good solutions to the underlying problem, I understand that a decision still had to be made. So although I disagree with that outcome, you've made a fair argument.

Then how about one of these alternatives:

1) Make man-db unconditionally depend on su, perhaps introducing a virtual/su package.

2) Make /etc/cron.daily/man-db a no-op if su is not installed (i.e. no side-effects AND no error message in the logs) and during installation notify the user to install su to make it work.

3) Make /etc/cron.daily/man-db non-executable by default, and notify the user that installing su and a chmod +x is needed to make it work.