Cfengine Configuration Examples

 [image of the Head of a GNU] [ English ]

Table of Contents


Links

 links:

   classes::

      /dir/link ->  /src/object
      /dir/link ->! /src/object          # force link
      
      /dir  +> /sourcedir                # link children 
      /dir  +> /sourcetree  recurse=inf  # link file tree

File checks

 files:

      /usr/local mode=755 recurs=inf owner=root links=tidy action=fixdirs

      /etc/motd              m=0644 r=0 o=root act=touch
      /.cshrc                m=0644 r=0 o=root act=touch

   PasswdServer::

      /local/iu/etc/passwd m=0644 o=root g=other action=fixplain
      /local/iu/etc/shadow m=0644 o=root g=other action=fixplain

   WWWServer::

      /local/iu/www                           m=775        g=www act=fixall r=inf
      /local/iu/httpd/conf                    m=664 o=root g=www act=fixall r=inf
      /local/iu/www/cgi-bin-public/count_file m=777 o=root g=www act=fixplain

   FTPserver::

      $(ftp)/pub        mode=644 o=ftp  g=ftp  r=inf act=fixall
      $(ftp)/etc        mode=111 o=root g=other      act=fixdirs
      $(ftp)/usr/bin/ls mode=111 o=root g=other      act=fixall
      $(ftp)/dev        mode=555 o=root g=other      act=fixall
      $(ftp)/usr        mode=555 o=root g=other      act=fixdirs

File copying (rdist/rpull)

copy:

      $(nisfiles)/hosts.deny dest=/etc/hosts.deny o=root mode=0644
      $(nisfiles)/ntp.drift dest=/etc/ntp.drift mode=644
      $(nisfiles)/shells dest=/etc/shells mode=644

    BackupServer.Hr03::

      /home/mark dest=/backup/mark server=nexus r=1 backup=false

Tidying files

tidy:

     home                 pat=.rhosts                      age=0 # Security
     home                 pat=core             r=inf       age=0
     home                 pat=a.out            r=inf       age=1
     home                 p=*%                 r=inf       age=2
     home                 p=*~                 r=inf       age=2
     home                 p=#*                 r=inf       age=1    
     home                 p=*.dvi              r=inf       age=14   type=ctime
     home                 p=*.log              r=inf       age=2

     home/.netscape-cache  p=cache????*         r=inf       age=0
     home/.MCOM-cache      p=cache????*         r=inf       age=0

Editing Files

editfiles:

      { /etc/inetd.conf

      AppendIfNoSuchLine "cvspserver  stream  tcp  nowait  root  /local/gnu/bin/cvs cvs -b /usr/local/bin pserver"
      }

Disabling files

disable:

  solaris2.6::

    /etc/power.conf

 Tuesday::

   #
   # Disabling these log files weekly prevents them from
   # growing so enormous that they fill the disk!
   #

   /local/iu/httpd/logs/access_log   rotate=empty
   /local/iu/httpd/logs/agent_log    rotate=empty
   /local/iu/httpd/logs/error_log    rotate=empty
   /local/iu/httpd/logs/referer_log  rotate=empty

   #
   # CERT warning, security fix
   #

  any::

    /usr/lib/expreserve

  FTPserver.Sunday.All::

   /local/iu/xferlog rotate=3

Shell commands/scripts

shellcommands:

      "$(cfbin)/cfbackup -p -f /iu/nexus/backup1 -s /iu/nexus/ud"
      "$(cfbin)/cfbackup -p -f /iu/nexus/backup1 -s /iu/nexus/ua"

      #
      # Update the GNU find/locate database each night
      #
 
      "$(gnu)/lib/locate/updatedb"


[ English ]

Return to GNU's home page.

Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are also other ways to contact the FSF.

Please send comments on these web pages to webmasters@gnu.org, send other questions to gnu@gnu.org.

Copyright (C) 2001 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

Updated: $Date: 2001/07/04 03:19:38 $ $Author: brett $