Bug 500694 - cronie don't use environment from /etc/crontab
cronie don't use environment from /etc/crontab
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: anacron (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Marcela Mašláňová
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-13 13:54 EDT by Remi Collet
Modified: 2009-06-18 07:50 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-15 08:01:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Remi Collet 2009-05-13 13:54:37 EDT
cronie-1.2-7.fc11.x86_64

According to man page

"PAM Access Control: On Red Hat systems, crond now supports access control with PAM - see pam(8).  A PAM configuration file for crond is installed in  /etc/pam.d/crond.  crond loads the PAM environment from the pam_env module, but these can be overriden by settings in the crontab file."

Standard installation :
/etc/security/pam_env.conf is empty (only comments)
/etc/environment is empty
/etc/crontab :

   SHELL=/bin/bash
   PATH=/sbin:/bin:/usr/sbin:/usr/bin
   MAILTO=root
   HOME=/

But for running task :

   PATH=/usr/bin:/bin
   SHELL=/bin/sh

So I think value should be taken from /etc/crontab.
What did I miss ?
Comment 1 Tomas Mraz 2009-05-13 15:52:01 EDT
I suppose that you're editing either user's crontab with crontab -e or some crontab in /etc/cron.d/ directory. Each crontab is individual and the environment variables specified in that crontab apply only to that crontab.
Comment 2 Remi Collet 2009-05-14 00:58:47 EDT
No, it's a /etc/cron.hourly script (provided by ocsinventory-agent rpm, which need /sbin in path).

Where is defined the defaut environment for it ?

- Previously, hourly task where launch by "run-parts" in /etc/crontab, so use the env. defined there

- It seems it is now launched by /etc/cron.d/0hourly where there is no env. defined

This seems to explain the difference between F10/F11 which can be consider as a "regresion".

I don't have done any test for daily/monthly script, but it could be a solution to add same env. in /etc/cron.d/0hourly that in /etc/crontab to keep same behaviour than in previous release.

Regards
Comment 3 Tomas Mraz 2009-05-14 02:46:16 EDT
Yes, that's a good idea.
Comment 4 Marcela Mašláňová 2009-05-15 08:01:18 EDT
The cron man page will be updated and cron jobs in anacron package has environment values now.
Comment 5 Fedora Update System 2009-06-09 10:34:55 EDT
anacron-2.3-75.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/anacron-2.3-75.fc11
Comment 6 Fedora Update System 2009-06-18 07:50:28 EDT
anacron-2.3-75.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

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