On Thu, Jan 19, 2017 at 8:45 AM, Gilles Dartiguelongue <[email protected]> wrote:
> Le mercredi 04 janvier 2017 à 21:12 +0000, Wolfgang Mueller a écrit :
>> is definitely not set when executing cron scripts like that. I
>> deleted all mandoc.db files and waited for them to be regenerated.
>> Only
>> the one in /usr/share/man was generated, which means that makewhatis
>> fell back to the defaults since MANPATH was empty.
>>
>> Just as I am composing this mail, the cron script that had `source
>> /etc/profile' in it before makewhatis ran, and all the databases are
>> there.
>>
>> Bottom line: MANPATH is not available in cron scripts.
>
> Could you open a bug report on https://bugzilla.gentoo.org/, I think
> this could be a very long standing bug.
It's debatable whether this is a "bug" or not; I don't think it really is.
crontab(1p) says this:
Upon execution of a command from a crontab entry, the implementa‐
tion shall supply a default environment, defining at least the fol‐
lowing environment variables:
HOME A pathname of the user's home directory.
LOGNAME The user's login name.
PATH A string representing a search path guaranteed to find
all of the standard utilities.
SHELL A pathname of the command interpreter. When crontab is
invoked as specified by this volume of POSIX.1‐2008, the
value shall be a pathname for sh.
If a script executed by cron needs additional env vars, it should
probably source /etc/profile or /etc/profile.env itself.