Last modified: 2013-06-03 13:47:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50475, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48475 - $PATH is different in interactive shells and cron jobs
$PATH is different in interactive shells and cron jobs
Status: RESOLVED WONTFIX
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Marc A. Pelletier
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-14 22:37 UTC by Tim Landscheidt
Modified: 2013-06-03 13:47 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tim Landscheidt 2013-05-14 22:37:05 UTC
PATH for interactive shells is $HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games, for cron jobs it's set to /usr/bin:/bin.  Fixing this would require patching cron.  (BTW: Ubuntu ships the original ISC cron?  In 2013?  Really?)

As for example $HOME/bin is added by ~/.profile, a good case could be made that instead of chasing cars^W^Wtrying to emulate the individual user's interactive environment in cron, it would be much more efficient to educate users to add "PATH=..." as the first line to their crontab.
Comment 1 Marc A. Pelletier 2013-06-03 13:47:05 UTC
I agree that an explicit PATH= in the crontab is the preferred solution.

It is generally unwise to rely on an environment-provided PATH for a number of reasons, not least of which is the number of different ways in which an environment can be set up before a tool is invoked.

Default-provided PATH should be seen as a convenience for interactive use.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links