help-cfengine
[Top][All Lists]
Advanced

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

Cfexecd patch


From: Chip Seraphine
Subject: Cfexecd patch
Date: Fri, 15 Oct 2004 08:45:44 -0500
User-agent: KMail/1.5.4

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





reply via email to

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