Page 1 of 3

Completely disable anacron but leave cron on.

Posted: 2011/07/28 10:46:47
by sblantipodi
Hi all...

Hi want to completely disable anacron but I don't want to disturb crond.

To do it I edited /etc/anacrontab and commented those lines
#period in days delay in minutes job-identifier command
#1 5 cron.daily nice run-parts /etc/cron.daily
#7 25 cron.weekly nice run-parts /etc/cron.weekly
#@monthly 45 cron.monthly nice run-parts /etc/cron.monthly

Then I removed the 0anacron file in cron.hourly...

Doing that succesfully disabled anacron for cron.weekly and cron.daily since this tasks are executed from crond only.

The problem is that cron.hourly is executed two times, one time from crond and one time from anacron...
How can I completely disable anacron?

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/28 16:29:06
by pjwelsh
As root [code]chkconfig anacron off
service anacron stop[/code] should be all you need.

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/28 16:42:37
by sblantipodi
[quote]
pjwelsh wrote:
As root [code]chkconfig anacron off
service anacron stop[/code] should be all you need.[/quote]

service anacron stop
anacron: unrecognized service

its strange...
if anacron is stopped why the script on cron.hourly is executed two times?

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/28 21:45:33
by sblantipodi
what is the name of anacron service?

I cannot neither do
service anacron start
since the service is not recognized.

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/28 21:53:35
by AlanBartlett
On a [i]RHEL 6.1[/i] system, I see --

[code]
[ajb@Duo2 ~]$ rpm -qa \*cron\*
crontabs-1.10-33.el6.noarch
cronie-1.4.4-7.el6.x86_64
cronie-anacron-1.4.4-7.el6.x86_64
[ajb@Duo2 ~]$ sudo yum info cronie cronie-anacron
[i]<snip>[/i]
Installed Packages
Name : cronie
Arch : x86_64
Version : 1.4.4
Release : 7.el6
Size : 166 k
Repo : installed
From repo : rhel-x86_64-server-6
Summary : Cron daemon for executing programs at set times
URL : https://fedorahosted.org/cronie
License : MIT and BSD and ISC and GPLv2
Description : Cronie contains the standard UNIX daemon crond that runs specified programs at
: scheduled times and related tools. It is a fork of the original vixie-cron and
: has security and configuration enhancements like the ability to use pam and
: SELinux.

Name : cronie-anacron
Arch : x86_64
Version : 1.4.4
Release : 7.el6
Size : 43 k
Repo : installed
From repo : rhel-x86_64-server-6
Summary : Utility for running regular jobs
URL : https://fedorahosted.org/cronie
License : MIT and BSD and ISC and GPLv2
Description : Anacron became part of cronie. Anacron is used only for running regular jobs.
: The default settings execute regular jobs by anacron, however this could be
: overloaded in settings.

[ajb@Duo2 ~]$ rpm -ql cronie
/etc/cron.d
/etc/cron.d/0hourly
/etc/cron.deny
/etc/pam.d/crond
/etc/rc.d/init.d/crond
/etc/sysconfig/crond
/usr/bin/crontab
/usr/sbin/crond
/usr/share/doc/cronie-1.4.4
/usr/share/doc/cronie-1.4.4/AUTHORS
/usr/share/doc/cronie-1.4.4/COPYING
/usr/share/doc/cronie-1.4.4/ChangeLog
/usr/share/doc/cronie-1.4.4/INSTALL
/usr/share/doc/cronie-1.4.4/README
/usr/share/man/man1/crontab.1.gz
/usr/share/man/man5/crontab.5.gz
/usr/share/man/man8/cron.8.gz
/usr/share/man/man8/crond.8.gz
/var/spool/cron
[ajb@Duo2 ~]$ rpm -ql cronie-anacron
/etc/anacrontab
/etc/cron.hourly/0anacron
/usr/sbin/anacron
/usr/share/man/man5/anacrontab.5.gz
/usr/share/man/man8/anacron.8.gz
/var/spool/anacron
/var/spool/anacron/cron.daily
/var/spool/anacron/cron.monthly
/var/spool/anacron/cron.weekly
[ajb@Duo2 ~]$
[/code]

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/28 21:54:15
by TrevorH
But anacron doesn't do anything with /etc/cron.hourly. Are you sure you don't have duplicate lines in /etc/crontab that invoke runparts twice for /etc/cron.hourly?

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/28 21:54:49
by sblantipodi
service cronie-anacron status
cronie-anacron: unrecognized service

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/28 21:57:21
by sblantipodi
Just double checked, no duplicate entries in crontab.

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/28 22:05:15
by AlanBartlett
How about --

[code]
[b]sudo yum remove cronie-anacron[/b]
[/code]
Of course, it may also want to remove [i]cronie[/i]. :roll:

Re: Completely disable anacron but leave cron on.

Posted: 2011/07/29 06:27:30
by sblantipodi
Obviously I don't want to remove crond. :(