[Bug 1081379] [NEW] cron ignoring PATH from crontab

Launchpad Bug Tracker 1081379 at bugs.launchpad.net
Wed Nov 21 01:04:55 UTC 2012


You have been subscribed to a public bug:

cron 3.0pl1-120ubuntu4 appears to be ignoring the environment variables
in /etc/crontab, or at least PATH.

Per crontab(5) man page:

       Several environment variables are set up automatically by the cron(8) daemon.  SHELL is set to /bin/sh, and LOGNAME and HOME are set from the /etc/passwd line of the crontab's owner.  PATH  is
       set to "/usr/bin:/bin".  HOME, SHELL, and PATH may be overridden by settings in the crontab; LOGNAME is the user that the job is running from, and may not be changed.

I did the following simple test to demonstrate that /usr/bin:/bin is
being used as the PATH, and it is not being overriden as described. I'm
using the system default /etc/crontab contents. I added a cron entry
that just writes the output of "env".

cdodt 2 ~% cat /etc/crontab
[. . .]
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
[. . .]


root at blueprint:~# crontab -l
* * * * * env > ~/cronenv


root at blueprint:~# cat cronenv 
HOME=/root
LOGNAME=root
PATH=/usr/bin:/bin
LANG=en_US.UTF-8
SHELL=/bin/sh
PWD=/root


PATH, set from /etc/crontab, is not being used. Am I missing something?

** Affects: cron (Ubuntu)
     Importance: Undecided
         Status: New

-- 
cron ignoring PATH from crontab
https://bugs.launchpad.net/bugs/1081379
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to cron in Ubuntu.




More information about the foundations-bugs mailing list