help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: restart cron in Solaris


From: Ted Zlatanov
Subject: Re: restart cron in Solaris
Date: Fri, 07 Dec 2001 08:51:51 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i386-redhat-linux-gnu)

Daniel Nilsson <dlist@nlsn.nu> writes:

> Does sending HUP to cron really reread crontabs in Solaris?
>
> Ive tried:
>
> "cron"     signal=hup inform=false
>
> But it doesnt work...
>
> How are you editing crontabs? (crontab -l > /tmp/aaa;vi /tmp/aaa;crontab
> /tmp/aaa) ???

Note that this doesn't work for fcron, anacron, and such without some
work.  But it's been behaving well at our site.  Defining the
RestartCrontab class didn't work reliably, so I always resubmit the
crontab (feeding a crontab to cron is the most reliable way of
ensuring it will recognize it, in my experience - the HUP signal is
the second most reliable way).

Parts of this are based on past discussion on the cfengine mailing
list.

Ted

------------------------------

control:

# where is the crontab command hiding?
 linux|hpux|irix|irix64|freebsd::crontab = ( /usr/bin/crontab )
 hpux10|aix|sun4|solaris::       crontab = ( /bin/crontab )
 osf::                           crontab = ( /usr/ucb/crontab )

# where is the root crontab file hiding?
 aix|hpux::              root_crontab = ( /usr/spool/cron/crontabs/root )
 hpux10|irix|irix64|osf|sun4|solaris::
                         root_crontab = ( /var/spool/cron/crontabs/root )
 linux::                 root_crontab = ( /var/spool/cron/root )
 ultrix|freebsd::        root_crontab = ( /etc/crontab )

editfiles:
  { $(root_crontab)
    SetLine "0 * * * *  /etc/cfengine/cfhourly"
    AppendIfNoLineMatching ".*cfhourly.*"
    SetLine "* * * * * /etc/cfengine/cfminute"
    AppendIfNoLineMatching ".*cfminute.*"
    DefineClasses "RestartCrontab"
  }

shellcommands:
# this will always be run, because DefineClasses doesn't work right
# RestartCrontab:: 
 any::
  "$(crontab) $(root_crontab)"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]