> 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 "[EMAIL PROTECTED]" "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/>
_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine

Reply via email to