Forum: CFEngine Help
Subject: Re: CFEngine Help: Re: Define classes if a process is running or not
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,26866,26935#msg-26935

Sorry that I don't follow the thread from start, but this is a kind of promise 
you'd like?


processes:
 redhat6::
   "rhsmcertd"
       process_stop => "/etc/init.d/rhsmcertd stop",
       process_count => anyprocs("job_done");
       
 reports:
  job_done::
   "WARNING> Service \"rhsmcertd\" is stopped";

...
...
...

body process_count anyprocs(x)
{
match_range => "0,0";
out_of_range_define => { "$(x)" };
}


The warning should be in /var/cfengine/outputs or syslog if executed by 
cf-execd. Also you may use "report_to_file" to append this line to any files 
you want.
https://cfengine.com/manuals/cf3-Reference#report_005fto_005ffile-in-reports

Cheers,
-- Nakarin

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to