help-cfengine
[Top][All Lists]
Advanced

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

Re: cfengine cronjob on pool of servers


From: Christopher Browne
Subject: Re: cfengine cronjob on pool of servers
Date: Thu, 29 Dec 2005 21:10:40 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, berkeley-unix)

> Can cfengine do this? Nicelly, easy and without hacks please!
>
> We need to schedule a script to run on ONLY ONE of the N hosts.
> The catch is that any host could be down at any moment in the future,
> so schedulling cronjob on one of the hosts is not a reliable option.
> Also the job cannot be run more that once (ie cannot be run from
> multiple hosts).

This isn't the sort of thing that cfengine is designed to provide
answers for.

What you actually need is some sort of central authority; part of the
point of cfengine is to not have that vulnerability.

If I had a database server around, I'd be inclined to use it to manage
this sort of "locking" problem.  

All N hosts would *attempt* to run the cron job; they start by telling
the DB server "I am the only one that will be running this process."
Only one would succeed (let's say they all try to insert the desired
time and job name into a table with unique index on time/job); the
"winner" gets to continue and run the job.
-- 
(format nil "~S@~S" "cbbrowne" "acm.org")
http://linuxdatabases.info/info/x.html
Rules of the Evil Overlord #67.  "No matter how many shorts we have in
the system, my  guards will be instructed to  treat every surveillance
camera malfunction as a full-scale emergency."
<http://www.eviloverlord.com/>


reply via email to

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