Bug 404154

Summary: Cron does not invoke folder /usr/local/bin (only /usr/bin)
Product: [openSUSE] openSUSE 10.2 Reporter: Wiki Melancholie <wiki.melancholie>
Component: OtherAssignee: Matthias Koenig <mkoenig>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Wiki Melancholie 2008-06-26 15:20:50 UTC
Pre-note: This occurs with openSUSE 10.1 (on a V-Server), but I think this probably would also happen with 10.x and 11.0! If so, this should be fixed in v11.

The original version of Python was 2.4.2, too old for me. So I installed Python 2.5.2 by using 'make'.

If I am typing "python -V" it shows me 2.5.2.
If I create a shell script containing "python -V" it also shows me 2.5.2.

But if I add that script to my cronjobs, it will output 2.4.2! Oddly, the file "/usr/bin/python2.4" is used then! Why does "python" use/link to "python2.4" instead of "python2.5" if run by cron?

Directly running "python2.5" or "/usr/local/bin/python" works though ;-)
Comment 1 Wiki Melancholie 2008-06-27 13:31:48 UTC
Oh, stating "python2.5" does not work either with cron.

The reason is that cron only uses /usr/bin/python(2.4) (but not /usr/local/bin/python(2.5))!

Shouldn't cron be allowed to use also /usr/local/bin versions?
Comment 2 Matthias Koenig 2008-07-17 15:47:15 UTC
No, the default path is intentionally restricted.
But you can set the PATH environment variable in your crontab, for example
to
PATH=/usr/local/bin:/usr/bin:/bin