help-cfengine
[Top][All Lists]
Advanced

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

RE: Cfexecd patch


From: Wheeler, John
Subject: RE: Cfexecd patch
Date: Fri, 15 Oct 2004 10:31:03 -0500

Most excellent! I cheat an export an env var. This is much cleaner.

> -----Original Message-----
> From: address@hidden
[mailto:help-cfengine-
> address@hidden On Behalf Of Chip Seraphine
> Sent: Friday, October 15, 2004 8:46 AM
> To: address@hidden
> Subject: Cfexecd patch
> 
> 
> 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





reply via email to

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