help-cfengine
[Top][All Lists]
Advanced

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

Re: file edit


From: Daniel Nilsson
Subject: Re: file edit
Date: Thu, 7 Feb 2002 09:20:13 +0100 (CET)

My cf.sendmail is below.

( One problem is that if the m4_run crashes, we dont fix it next
cfengine-run. I would like cfengine to use the "DefineClass" even if the
file isnt edited. )

##################################################################
#
# cf.sendmail
#
##################################################################

 #####
 #
 # BEGIN cf.sendmail
 #
 #####

editfiles:

        solaris::
        { /etc/mail/sendmail.cf
          BeginGroupIfNoLineContaining "My-null-Client v0.1"
            AppendIfNoSuchLine "#dummy-cfengine-mark"
            DefineClasses "sendmail_edit:m4_run:sendmail_restart"
          EndGroup
        }

        sendmail_edit.solaris::
        { /usr/lib/mail/cf/null.mc
          AutoCreate
          BeginGroupIfNoLineContaining "My-null-Client v0.1"
            EmptyEntireFilePlease
            AppendIfNoSuchLine "VERSIONID(`My-null-Client v0.1')"
            AppendIfNoSuchLine "OSTYPE(`solaris2')"
            AppendIfNoSuchLine
"FEATURE(`nullclient',`mailhost.mydomain.com')"
            AppendIfNoSuchLine "MASQUERADE_AS(`mydomain.com')"
          EndGroup
        }

shellcommands:

        m4_run.solaris::

          "/usr/ccs/bin/m4 /usr/lib/mail/m4/cf.m4 null.mc >
/etc/mail/sendmail.cf"
          useshell=true
          chdir=/usr/lib/mail/cf

processes:

        sendmail_restart.solaris::

        "/usr/lib/sendmail"
        signal=term
        owner=root
        restart "/etc/init.d/sendmail start"

 #####
 #
 # END cf.sendmail
 #
 #####



On Wed, 6 Feb 2002, Ian Wallace wrote:

> Ok why does this work?  what's the m4_run doing in there?  And I'm assuming
> that the sendmail_restart is some shell command or process to restart
> sendmail?  Is the m4_run some other action sequence?  I think (if it has not
> already been done) this might want to be added to the tutorial (or maybe I'm
> just having problems seeing how this works ... I'll have to try this out ..
>
> thanks!
> cheers
> ian
>
> On Wednesday 06 February 2002 07:00 am, Daniel Nilsson wrote:
> > Found the solution. :)
> >
> > editfiles:
> >
> >        solaris::
> >
> >          { /etc/mail/sendmail.cf
> >            BeginGroupIfNoLineContaining "null-Client v0.1"
> >              AppendIfNoSuchLine "#cfengine-dummy-edit"
> >              DefineClasses sendmail_edit:m4_run:sendmail_restart
> >            EndGroup
> >          }
> >
> >
> >          sendmail_edit.solaris::
> >          { /usr/lib/mail/cf/null.mc
> >            AutoCreate
> >            EmptyEntireFilePlease
> >            AppendIfNoSuchLine "VERSIONID(`null-Client v0.1')"
> >            AppendIfNoSuchLine "OSTYPE(`solaris2')"
> >            AppendIfNoSuchLine  "FEATURE(`nullclient',`mailhost.my.domain')"
> >            AppendIfNoSuchLine "MASQUERADE_AS(`my.domain')"
> >          }
>
> --
> Ian Wallace - address@hidden
> Senior Consultant, Context Managed Services
> (W) 303.209.5623 (H) 303.388.9858
>
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-cfengine
>




reply via email to

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