1834142 Members
2323 Online
110064 Solutions
New Discussion

Re: Cron anomaly

 
SOLVED
Go to solution
John Robben
Advisor

Cron anomaly

I've performed the following test:

created user analyst

added user analyst to /var/adm/cron.cron.allow

as user analyst, created cron entry to run every minute

verified job runs via tail -f /var/adm/cron/log

removed user analyst from cron.allow

stop cron via /sbin/init.d/cron stop
start cron via /sbin/init.d/cron start

job still runs

What gives?

Does this mean that, as long as a file exists in /var/spool/cron/crontabs, commands contained within it will be run, regardless of the contents of /var/adm/cron/cron.allow?
5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: Cron anomaly

Yes, that is exactly it.

cron.allow only controls whether or not you can do a 'crontab -e','crontab -l', etc.

If the the users cron file exists in /var/spool/cron/crontabs, then it WILL continue to run. It doesn't matter if the user was deleted from /etc/passwd, removed from cron.allow, the cron jobs will still run.

cron jobs are not deleted when a user is deleted.
Sanjay_6
Honored Contributor

Re: Cron anomaly

Hi,

I believe, if the user id exist and the cron job is already scheduled, it would run. Removing the user from the cron.allow list only stopped the user from re-editing his cron job / or submitting any new cron jobs.

Hope this helps.

Regds
Deoncia Grayson_1
Honored Contributor

Re: Cron anomaly

Yes, that is exactly it. As long as the cron job exist, that job will run. Removing the user from cron.allow just stops the user from having access to editing the crontab.
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Jannik
Honored Contributor
Solution

Re: Cron anomaly

add the user to cron.allow again.
login as user.
do a crontab -e and remove the entry.
logout from user and remove the user from cron.allow and it will work.
jaton
John Robben
Advisor

Re: Cron anomaly

Thanks for the quick replies.