help-cfengine
[Top][All Lists]
Advanced

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

Re: Cfexecd patch


From: Russell Adams
Subject: Re: Cfexecd patch
Date: Fri, 15 Oct 2004 09:09:40 -0500
User-agent: Mutt/1.4.2.1i

Didn't someone have a script to detect this?

Would that someone like to share? ;]

Russell

On Fri, Oct 15, 2004 at 08:45:44AM -0500, Chip Seraphine wrote:
> 
> Very minor patch for cfexecd that causes it to set a 'from_cfexecd' class in 
> cfagent runs.  This allows your cfengine scripts to Do Stuff based on whether
>  or not the run was called from cfexecd.  (In my environment, this is quite 
> useful; for example, if I am being run from hand, I might wish to log 
> different information than a 'regular' scheduled run from efexecd.)
> 
> Patched against 2.1.10.
> 
> address@hidden:42:04-../cfengine-2.1.10/src$ diff -u cfexecd.src.orig 
> cfexecd.c
> --- cfexecd.src.orig    2004-10-08 10:46:11.600941000 -0500
> +++ cfexecd.c   2004-10-12 13:30:53.282950000 -0500
> @@ -213,7 +213,7 @@
> 
>  snprintf(VBUFF,CF_BUFSIZE,"%s/inputs/update.conf",WORKDIR);
>  MakeDirectoriesFor(VBUFF,'y');
> -snprintf(VBUFF,CF_BUFSIZE,"%s/bin/cfagent",WORKDIR);
> +snprintf(VBUFF,CF_BUFSIZE,"%s/bin/cfagent -D from_cfexecd",WORKDIR);
>  MakeDirectoriesFor(VBUFF,'y');
>  snprintf(VBUFF,CF_BUFSIZE,"%s/outputs/spooled_reports",WORKDIR);
>  MakeDirectoriesFor(VBUFF,'y');
> @@ -386,7 +386,7 @@
>    char cfcom[CF_BUFSIZE];
>    static char line[CF_BUFSIZE];
> 
> -snprintf(cfcom,CF_BUFSIZE-1,"%s/bin/cfagent -z",WORKDIR);
> +snprintf(cfcom,CF_BUFSIZE-1,"%s/bin/cfagent -D from_cfexecd -z",WORKDIR);
> 
>  if ((pp=cfpopen(cfcom,"r")) ==  NULL)
>     {
> @@ -569,11 +569,11 @@
> 
>  if (NOSPLAY)
>     {
> -   snprintf(cmd,CF_BUFSIZE-1,"%s/bin/cfagent -q",WORKDIR);
> +   snprintf(cmd,CF_BUFSIZE-1,"%s/bin/cfagent -q -D from_cfexecd",WORKDIR);
>     }
>  else
>     {
> -   snprintf(cmd,CF_BUFSIZE-1,"%s/bin/cfagent",WORKDIR);
> +   snprintf(cmd,CF_BUFSIZE-1,"%s/bin/cfagent -D from_cfexecd",WORKDIR);
>     }
> 
>  snprintf(line,100,CanonifyName(ctime(&starttime)));
> 
> 
> -- 
> 
> Chip Seraphine
> Unix Administrator
> TradeLink, LLC
> 312-264-2048
> address@hidden
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-cfengine
-----------------------------
Russell Adams
address@hidden
http://www.adamsinfoserv.com/




reply via email to

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