Completely disable anacron but leave cron on.

General support questions
sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/28 10:46:47

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?

pjwelsh
Posts: 2632
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: Completely disable anacron but leave cron on.

Post by pjwelsh » 2011/07/28 16:29:06

As root [code]chkconfig anacron off
service anacron stop[/code] should be all you need.

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/28 16:42:37

[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?

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/28 21:45:33

what is the name of anacron service?

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

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Completely disable anacron but leave cron on.

Post by AlanBartlett » 2011/07/28 21:53:35

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]

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Completely disable anacron but leave cron on.

Post by TrevorH » 2011/07/28 21:54:15

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?

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/28 21:54:49

service cronie-anacron status
cronie-anacron: unrecognized service

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/28 21:57:21

Just double checked, no duplicate entries in crontab.

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: Completely disable anacron but leave cron on.

Post by AlanBartlett » 2011/07/28 22:05:15

How about --

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

sblantipodi
Posts: 252
Joined: 2009/07/10 09:43:13
Contact:

Re: Completely disable anacron but leave cron on.

Post by sblantipodi » 2011/07/29 06:27:30

Obviously I don't want to remove crond. :(

Post Reply