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