Completely disable anacron but leave cron on.

General support questions

Completely disable anacron but leave cron on.

Postby 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?
sblantipodi
 
Posts: 203
Joined: 2009/07/10 09:43:13

Re: Completely disable anacron but leave cron on.

Postby pjwelsh » 2011/07/28 16:29:06

As root
Code: Select all
chkconfig anacron off
service anacron stop
should be all you need.
pjwelsh
 
Posts: 2555
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: Completely disable anacron but leave cron on.

Postby sblantipodi » 2011/07/28 16:42:37

pjwelsh wrote:
As root
Code: Select all
chkconfig anacron off
service anacron stop
should be all you need.


service anacron stop
anacron: unrecognized service

its strange...
if anacron is stopped why the script on cron.hourly is executed two times?
sblantipodi
 
Posts: 203
Joined: 2009/07/10 09:43:13

Re: Completely disable anacron but leave cron on.

Postby 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.
sblantipodi
 
Posts: 203
Joined: 2009/07/10 09:43:13

Re: Completely disable anacron but leave cron on.

Postby AlanBartlett » 2011/07/28 21:53:35

On a RHEL 6.1 system, I see --

Code: Select all
[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 ~]$
User avatar
AlanBartlett
Forum Moderator
 
Posts: 8975
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk

Re: Completely disable anacron but leave cron on.

Postby 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?
User avatar
TrevorH
Forum Moderator
 
Posts: 9164
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Completely disable anacron but leave cron on.

Postby sblantipodi » 2011/07/28 21:54:49

service cronie-anacron status
cronie-anacron: unrecognized service
sblantipodi
 
Posts: 203
Joined: 2009/07/10 09:43:13

Re: Completely disable anacron but leave cron on.

Postby sblantipodi » 2011/07/28 21:57:21

Just double checked, no duplicate entries in crontab.
sblantipodi
 
Posts: 203
Joined: 2009/07/10 09:43:13

Re: Completely disable anacron but leave cron on.

Postby AlanBartlett » 2011/07/28 22:05:15

How about --

Code: Select all
[b]sudo yum remove cronie-anacron[/b]

Of course, it may also want to remove cronie. :roll:
User avatar
AlanBartlett
Forum Moderator
 
Posts: 8975
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk

Re: Completely disable anacron but leave cron on.

Postby sblantipodi » 2011/07/29 06:27:30

Obviously I don't want to remove crond. :(
sblantipodi
 
Posts: 203
Joined: 2009/07/10 09:43:13

Next

Return to CentOS 6 - General Support

Who is online

Users browsing this forum: Pantela and 11 guests