Anyone? Sincerely, -- Neil Watson 416-673-3465
help-cfengine-boun...@cfengine.org wrote on 2010-01-15 19:59:44: > Greetings, > > I have a question about setting ifelapsed to 0 for certain promises. > Consider this code. The goal is to repair a service config file. If > this happens stop the service. It is my hope on the final run the > processes promise will note that the process is missing and thus case > the commands promise to start the service. > > I know a separate promise for restarting is more conventional but I'm > hoping to avoid that. It is not uncommon to find services that have no > restart function. Also because 'I can'. So I'm hoping that this will > work. It's close but not quite. > > On the first run the config file is repaired. On the second run the > stop command is run. On the third run it was my hope that the processes > promise would note the lack of a running process and set a class for > the final commands promise to start the service. What actually happens > on the is the agent states that the processes promise has already been > verified. What have I misunderstood? > > processes: > > "${g.svc_proc[${service}]}", > action => immediate, > comment => > "Search for running process for service ${service}", > restart_class => > canonify("${service}_proc_missing"); > > commands: > > "${g.svc_stop[${service}]}", > ifvarclass => canonify("${g.svc_trg[${service}]}_copy_repaired"), > classes => cdefine( > "${g.svc_start[${service}]}_kept", > "${g.svc_start[${service}]}_stopped", > "${g.svc_start[${service}]}_failed" > ), > comment => > "Start $(service) if ${g.svc_trg[${service}]} changed."; > > "${g.svc_start[${service}]}", > ifvarclass => canonify("${service}_proc_missing"), > action => immediate, > classes => cdefine( > "${g.svc_start[${service}]}_kept", > "${g.svc_start[${service}]}_started", > "${g.svc_start[${service}]}_failed" > ), > comment => > "Start $(service) if proc ${g.svc_proc[${service}]} notrunning."; > > body action immediate > { > ifelapsed => "0"; > } > > -- > Neil Watson > Linux/UNIX Consultant > http://watson-wilson.ca > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine
CONFIDENTIALITY WARNING This communication, including any attachments, is for the exclusive use of addressee and may contain proprietary and/or confidential information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this communication and destroy all copies. AVERTISSEMENT RELATIF À LA CONFIDENTIALITÉ Ce message, ainsi que les pièces qui y sont jointes, est destiné à l’usage exclusif de la personne à laquelle il s’adresse et peut contenir de l’information personnelle ou confidentielle. Si le lecteur de ce message n’en est pas le destinataire, nous l’avisons par la présente que toute diffusion, distribution, reproduction ou utilisation de son contenu est strictement interdite. Veuillez avertir sur-le-champ l’expéditeur par retour de courrier électronique et supprimez ce message ainsi que toutes les pièces jointes.
_______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine