cfengine news

# cfengine changes and patches

    Numbers are [Major version].[Minor version].[Patch release]

     ***************** Minor Version 4 ********************

    1.4.0
       Debian systems now detected and have an additional class "debian" in addition to linux

       New option "define=class1,class2" to "copy" command defines a list
       of classes only if a file is copied.
       This allows followup actions to be added to other sections.

       Variable list iteration in shell-commands.   Enhanced iteration source code.

       New option in disable: size=, size=>, size=<  for byte size comparisons. Files are
       only disabled if the criterion is met.

       Hourly classes are added to the automatic class engine: Hr00 to Hr23 can now be used.

       Update messages in copy were erroneous in some cases, although copying was performed
       correctly. Fixed.

       Hyphens in hp-ux etc hard classes changed to underscores.

       It is now possible to override the name of the network interface in the control
       section of the program. This allows funny OS installations on unusual hardware
       to set the net interface for a specific class.
        control:

         nextstep::

          interfacename = ( blah0 )

      New editing commands:

         CommentLinesContaining,
         BeginGroupIfFileIsNewer,
         BeginGroupIfFileExists,
         BeginGroupIfNoLineContaining,
         AutoCreate

       Bug in alpha/netbsd with segmentation fault in exit() repaired,
       some kind of pointer misunderstanding with a null string.

       New safer algorithm for copying files, first copies a modified
       file to a new file on the local filesystem. When transfer is complete it is
       renamed into place. This helps avoid race-conditions and problems
       where copying is halted underway due to network lossage.

       New debugging option d3 provides summarial info.

       Timeout option in shellcommands allows timeouts after a fixed number
       of seconds.

       Timeouts in place for all RPC operations connected with "mount".

       Sizes in disable and tidy now may specify units, bytes, kilobytes, megabytes (b,k,m)
       First character significant only. e.g. size=30kilobytes is okay.

       include=, exclude= patterns in file searches

       Remote copying partially implemented with server daemon cfd.

       Typo in tidy concatenation with multiple wildcards fixed.

       Extra time classes added allowing a complete front end for cron. Additional
       manual chapter on this.

       copying of links without a directory reference now prepends "./"

       Copying now preserves hard links where possible.

       File Rotation in disable does not break file handles any more.

       Copied/disabled files now back up to .cfsaved whereas edited files
       back up to .cfedited, to avoid overwriting the backup in copy-then-edit
       scenarios.

       Checksum comparisons are now optimized by checking the number of
       bytes before launching into a checksum computation.

       Several new edit commands.

       New locking mechanism with atomic locks which allow several cfengine's
       to coexist. Also antispamming mechanisms built in.

       CheckResolv reworked to avoid editing each time.

       AddToFstab will add to file if fs mounted

       SplayTimes added. causes cfengine to sleep a unique amount
       of time for each host, up to a maximum time. Can be used to
       avoid race conditions and contention.

       Improved expression evaluation with parentheses.

       Support for Cray. (Unsure whether these choices will match
       all cray systems).

      beta2:

       New options -q -K for switching off locks

     ***************** Minor Version 3 ********************

    1.3.19
       Processes restart now not called unless zero matches found

       Preconfiguration file is now read in before parsing and
       searched for in CFINPUTS path.

    1.3.18
       Shell commands now log output with the name of the host and an
       abbreviated (15 most signigicant characters) command name so
       that it is idenitifiable.

       Tidy does not list directories opened except in debugging mode.

       Fully qualified name patch. Possible to get domiain name appended twice.

       Logfiles and lock/pid files now contain the hostname to avoid common name-space
       conflicts.

       A new logfile cfengine.last records the time at which cfengine last ran.

       David Masterson's configuration changes incorporated, plus several others.

       New classes irix4 and irix64 introduced for old irix and new 64 bit irix.

    1.3.17
        Configure changes and patches for IRIX.
        Method of looking for ortentry changed.
        --version and --help now obey new GNU standard.
        getopt kludge removed.

        Bug in copy with linktype = relative - this was previously
        ignored.

        ( Released only as an urgent fix for a user .. Not up to date
          with all reported suggestions... )

    1.3.16

        Support for BSDOS (bsdi/bsdos), nextstep and IRIX 4 added

        Outstanding bugs in the autoconf configuration fixed(?)

        control variable which is a more permanent form of the
        --underscore-classes switch.

           underscoreclasses = ( true )

        Tidy got broken in 1.3.15 - nothing was tidied. Fixed.

        Bug fix for very long kernel messages in NetBSD which
        overflowed the stack.

        Bug fix for fully qualified domainnames.

    1.3.15

        fully qualified host name with . replaced by _ now in class list
        new variable $(fqhost) contains proper fully qualified name

        Command line option --no-hard-classes switches off all internal
        class generation for emulation purposes.

        Manual patches from David Masterson.
        Small cosmetic alterations.

    1.3.14
        Early release for a special user...

        Further bugfix to pattern concatenator in the parser. Actions involving
        the root filesystem / would be ignored.

        It is now possible to use the option rmdirs=true/false in tidy
        to make cfengine remove *empty* directories.

        Segmentation fault in tidy fixed when root path is a directory.

        Command line option --underscore-classes (-U) renames the hard
        classes from sun4 to _sun4 to avoid any naming conflicts on hosts
        which are called "sun4". This does not apply to the other internal
        classes which already have enough underscores in them!

    1.3.13
        David Masterson and Knut-Håvard Aksnes have been busy improving
        my crooked autoconf/Makefile setup. Others have been sending me
        modifications too. At the risk of offending people, I have had to
        be selective in choosing a setup which I feel is the most "elegant".
        I still haven't decided how handle the documentation dir. So this will
        still fail if you don't have TEX. Don't worry about this.

        IsHomeDir checks whether file lies under VMOUNTPATH.

        * VMOUNTPATH is now a list, not a constant, allowing several search paths.

        Bug in tidying from / directory fixed. Patterns were not installed.

        (Another patch will follow shortly)

    1.3.12
        Truncated host names never got added to the class heap!! Fixed.
        Scanf bug workaround for BSD 4.3.

    1.3.11
        Bug fix for Insert functions in editfiles.

        Suggestion in manual for distributing /etc/motd without
        losing system specific info.

        System type "aos" added
        Configuration problems with autoconf on old BSD systems fixed.

        $(arch) is now truncated to uname.sysname if it overflows the buffer
        as it could if uname reads a very long kernel ID.

        Can now put quoted strings in resolv.conf like "order nis, bind" etc.
        If the first character is not a digit, "nameserver" is not prepended.

    1.3.10
        Disable now sets the mode of disabled files to 400, so that
        disabled binaries are actually disabled, not just moved!

        When backing up files by "copy" using the home/ directive (all users)
        file backups are not placed in the file repository, but left where the
        user can find them.

        added editfiles commands:

        UnCommentLinesMatching   "regexp"
        UnCommentLinesContaining "substr"
        InsertFile "filename"

        BeginGroupIfNoSuchLine bug fixed - did opposite!

        AIX class match is now version insensitive.

        Genuine autoconf setup is finally in use.
        Cfengine should now be able to work on some systems which don't have uname(2).

        Support added for:

           BSD4.3
           NewsOS4
           NetBSD

    1.3.9
        pointer test added to BeginGroupIfNoMatch which caused segmentation fault
        if file empty.
        New system type added: solarisx86

    1.3.8a
        Possible problem with directories not being created patched
        when copying certain patterns within a recursive link tree.
    1.3.8
        POinter reset error in EmptyFile.. fixed
        AIX ps option changed to -ef default
        Andreas Klussmann's discovery that I used fclose instead of pclose
        on some pipes - fixed.
        Perl invocation - yet again altered.

        A long overdue job in fixing up type mismatches with NULL/'\0' so that -w can
        be removed from gcc.

        Non initialized inclusions field fixed when copying a pattern during linking.
        Caused bus error/ segv.

    1.3.7
        Error in configure script introduced in 1.3.6 fixed.
        Typo fixed in copy files which caused mulitple copying
        and recursion depth was wrong by a count of one. No longer
        necessary to specify recurse=1 to copy between directories.

    1.3.6
        A valiant effort by David Masterson has revealed some code-typos
        and made an improvement in the Makefiles.
        -AutomountResources did not update files correctly.
        -LocateLineMatching awlays started from start of file. Now it begins
         from the current position.

        Some configurational peculiarities in sunos 4.1.4 fixed.
        (Lex is a stupid program. Always use flex if you can.)
        Extra syntax bits enabled in regex so that {n} matches of a regex
        can be specified. This allows you to write something like, kill
        all processes not owned by root, using something like

           processes:

              "\(root\)\{0\}"  signal=kill

        Some cosmetic changes to level 2 debugging

    1.3.5
        Bug in tidy files fixed - cfengine was missing some files
        it should have tidied due to a typo in the restructured
        routine.

        Bug in CommentNLines with complex delimiters fixed.
        UnCommentNLines added to match.

    1.3.4
        Linux config parameters no longer select i?86 but allow any
        match in order to cover m68000 machines.
    1.3.3
        Unfortuate semicolon removed which caused process matching to
        report a warning even during exact matches, even when everything ok.
    1.3.2
        Bug fix in the regex coding of 1.3.1 which made replacements non-global!
    1.3.1
        ReplaceAll "XXX" With "YYY" now uses a regular expression for XXX.

    ---------------------------------------------------------------------------

    1.3.0
        Bugfix: negation with -N did not negate temporary class definitions in
                the action sequence.

        Tidy now concatenates all operations on the same file in a
        sub list so that searches for several patterns can be
        undertaken without having to reparse the file tree each time
        a new pattern is defined.

        backup=true/false option added in copy
        can now use $(variable) in option= attributes in files,copy etc..
        copy re-renames the backup file back into place if copy fails to
        open the new file. NOTE default behaviour is silent.!

        disable options: rotate=, truncate is specif. by rotate=empty

        Uf you use the --use-env option, or -u:
        New environment variable defined for cfengine and its child shells
        CFALLCLASSES is an up-to-date list of all currently defined classes
        separated by colons. You can view this changing by running with -d2

        If you don't use this option (whihc causes Bus error on some sys 5)
        use the $(allclasses) variable which contains teh same string
        and may be passed as a parameter to scripts.

        New option to tidy  size={number|empty}. If string is empty will
        look for empty files to delete which are older than the age.
        Also type=ctime,mtime,atime (default=atime)

        Tidy now matches dotted files to * everywhere.

        Recursive copy. Will traverse mounted filesystems by default.
        This can be controlled by specifying a max level of recursion.
        Ignores dirs in the ignore list.

        copy now uses ctime instead of mtime to catch changes
        in permissions.

        new copy option: type=(ctime/checksum) uses md5 checksums
        to establish copy condition. NOTE WHEN COPYING
        file dest=path/file (must have fiel as last link, can't use
        implicit directory form).

        editfiles: SetLine sets a string which is used by
        AppendIfNoLineMatching.

        New link types:
           type=absolute  - convert (symbolic) link to its true absolute path
                            expanding nested symbolic links to a maximum
                            of 15 levels only and eliminating . and ..
           type=relative  - convert (symbolic) link to relative path
                            prepending ../../.... etc and compressing
                            the remainder to eliminate . and .. No
                            further symlinks are expanded, since it's asssumed
                            that the name of the dir. it is relative to is
                            sigificant for personal reasons.

        All link types are inherited by multiple child link operations.

        (end snapshot b)

        New action type: processes, for checking for the existence of
        and signalling/restarting existing processes.

        A pipe is opened to the local ps command. Default options are
        -ax for BSD and -ef for sysV. (These can be changed in the cfrc file)
        or with SetOptionString "OPTIONSTRING". New resource names are pscomm and psopts in cfrc.
        cfengine reads the process table once for each change of option string.
        Cfengine looks for the first idenitifiable number to get the pid of the
        relevant process. Note that cfengine blocks on the restart command, so this
        is only suitable for restarting daemons whcih dissociate themselves from the
        terminal.

        signal=signal-type, matches=>0 should be at least one running
                            matches=<4 warn if more than 4 running

     *  New control lists:

           excludecopy = ( list ... ) # Do not copy any files matching these patterns
           excludelink = ( list ... ) # Do not link any files matching these patterns
           copylinks   = ( list ... ) # Copy instead of linking these patterns
           linkcopies  = ( list ... ) # Link instead of copying these patterns

        The copying gets done by the ctime method, links are made symbolic, without
        forcing. This allows the possibility of overriding locally.
        NOTE: that when these are placed under class specifiers class:: the relevant
        entries become bound to the classes which contain them.

        Local forms of this feature can be given with

          exclude=pattern1 exclude=pattern2
          copy=pattern1 copy=pattern2
          symlink=pattern1 ...

        If you try to set copy for relative/absolute/hard links, the error
        "Illogical combiation of copy and linktype" occurs.

     *  New edit option FixEndOfLine "dos/unix" to convert ascii-filetypes between these
        platforms.

        Now possible to use the "home" directive in editfiles, giving the possibiliyt
        of editing every users login files for instance.

        ( snap c )

        Recursive link trees possible
        Some bugs fixed in snapshot c
        Manual changes

        ( snap d)

        Various
        AbortAtLineMatching "regex" now causes editfiles to abort
        repetetive operations at a specified line, i.e. go no further than ...
        Manual changes

        ( snap e)

        copytype option for links  e.g. copytype=checksum
        linktype option for copy   e.g. linktype=relative

        options for links, copy: include=pattern to determine
        a list of files which are to be included. i.e. copy/link
        include && !exclude

        A file repository directory can now be defined. Whenever
        cfengine disables or saves an old file, it is stored
        in the repository using a unique name. This can then be
        inspected or tidied at will.

        ( snap f )

        Manual changes, some bugs in snapshot e fixed.

        New edit command: AutmountDirectResources dumps the filesystem resource
        database into the named file in the form of a direct automount map.

        Distribution now includes a postscript and html version of the manual.

        ( snap g )

        copy to home uid fix - broken by code rationalization in 1.3.0 e

        New classes 32_bit, 64_bit etc, determined by sizeof(long) at
        compilation time. This may change if a better test is found.

        New variables $(spc), $(tab), $(cr) and $(lf) expand simply
        to a spae, tab, cr, lf characters. This provides a way of having
        spaces in filenames etc.

        Can include quoted strings in macros in order to have spaces in
        variables or make lists. (see below)

        control variables: split = ( : ), repchar = ( _ )
        defines the character used for separating a list of paths
        in a variable like in PATH=/usr:/bin:etc
        reposchar is the character used in converting filenames by the
        repository.
        Values may be quoted or unquoted to allow spaces etc.

        Associated variables $(repchr) $(split)

        ( snap h )

        Bug fixes in 1.3.0-h

        New locking policy. If lock creation fails but no lock is found,
        cfengine continues in no-contention mode, allowing files systems
        to be tidied etc incase disk is full.

        Perl wrapper script "cfbg" for placing shellcommands in the background,
        to avoid blocking on long scripts.

        Incorrect behaviour fixed. Class dependence of ignore was ignored!

        ( snap h2 )

    ***************** Minor Version 2 ********************

    1.2.0
      File tree copying/images implemented. Instead of linking you can now
      physically copy files and keep them updated from a master set. (Handy if
      the master is on a filesystem which is not always mounted.)

        -Copy single file from master (with update based on mtime)
        -Copy all children in a directory (subdirs must be mentioned explicitly)
        -Copy files to all users (using home directive) e.g. .cshrc, .mwmrc, .xsession

      DeleteLinesMatching "" added in editfiles

      -E (enforce-links) option now queries y/n before proceeding and must
      therefore be run in interactive mode.
    1.2.1
      Bug in editfiles fixed: ***CommentItemMatching did the exact opposite
      of what it was supposed to!
      Parser bug for linkchildren fixed - parser would complain with "Links requires path or varitem"
      Shellcommands accepts scripts starting with $(variable)
    1.2.2
      New basic config files example structure!
      --silent now suppresses runtime warnings
      touch in files changes to specified protection instead of warning
    1.2.3
      action=silent added to links on an entry basis
    1.2.4
      OR ing of classes allowed by a.b.c|d.e.f etc
    1.2.5
      Editfiles data structure error fixed. Installation
      of empty file actions.
    1.2.6
      Regular expression commands added and old Matching
      functions now accept GNU regular expressions as well as
      exact strings.
      Several new editing commands.
    1.
      Improved manual, hints and tips compendium. FAQs etc.
      Improved structure in example files.
    1.2.8
      Segmentation bug in Prepend during debugging output. Fixed.
    1.2.9
      Parsing error in some mode strings involving setuid bits fixed.
    1.2.10
      Manual texinfo bug fixed.
      Append/PrepIfNoLineMatching synonyms for Append/PrepIfNoSuchLine, uses regex now.
      DeleteNLines "n" from pointer in editfiles.
      "+" allowed in filenames
      Possibility to create hardlinks with option a -> b type=hard
      Possible to create relative links /absolute -> ../relative
      $ can be used in strings, without parse error about bad variable
      Single quotes can be used instead of double to avoid clashes with " in strings
    1.2.11
      Fixed bug in editfiles abort sequence
      Fixed segmentation fault in DeleteTo.. with uninitialized file pointer.
      mode / ownership bug in copy: (fixed)
      Bug reading last line of files not ending in \n in editfiles,fixed.
    1.2.12
      Some sloppy declaration omissions corrected!
      Exit status = 1 on syntax error.
      Type corrections to ifconf
    1.2.13
       New editfiles functions, conditional with Begin/End
       Minor but important changes to some of the new edit commands
       SetCommentStart/End added to editfiles enabling generic commenting delimiters
       ReplaceAll "string1" With "string2" in editfiles.
       CommentNLines in editfiles
    1.2.14
       BeginGroupIfNoSuchLine
       BeginGroupIfNoLineMatching
       groups may now refer to previously defined groups as members
    1.2.15
       In groups you can now run a shell script to determine the value
       of a class. e.g.

       have_cc = ( "/bin/test -f /usr/ucb/cc" "/bin/test -f /local/gnu/cc"  )

       Some new hard classes are defined which cover the OS version numbers
       in detail. Run cfengine -p -v to see what they are.

       Permissions in copy fix.

    1.2.16
       Source code rationalization and copy/paste fixes.
       New class hpux10 for new svr4 structure in hp machines.
    1.2.17
       Code inaccuracies fixed and problems with native compilers
       under HPUX and Solaris fixed.
       A bug in netstat classes introduced in 1.2.16 is fixed.
    1.2.18
       A bug in ignore is fixed for tidy.
       An omission in editfiles is added so that BeginGroup actually
       gets recognized by the parser!!!!
       Bug and web adresses added to the manual intro.
       MakePathsFor now allows links when checking if directories exist.
    1.2.19
       Bug in class installation fixed for interclass dependencies.
       Global replace truncates some lines in editfiles - fixed.
    1.2.20
       Bug in editfiles classes: actionsequences editfiles.one editfiles.two
       not correctly distinguished per file action -- only per file. Fixed.
    1.2.21
       Segmentation fault bug introduced in 1.2.20 (!) fixed. oops.
    1.2.22
       Tidyfiles: home/subdirectory changes.
    1.2.23
       Two new internal variables:
       $(class) contains the string of the system hardclass - e.g. sun4,hpux
       $(arch) contains the detailed system type - an amalgamation of data from
       uname.
       linkchildren wouldn't accept variables in pathnames - fixed.
       Recursion in subdirs of home fixed.
    1.2.24
       Problem opening files in root directory - tried to open current
       directory instead on some sun systems. Problem patched.

       Extra option added to copy: force=true/false to force copying
       of files regardless of date.

       Logical NOT operator added for classes : !
       For instance:

           !myhost         # any host except myhost
           mygroup.!myhost # all hosts in group "mygroup" except myhost

    1.2.25
        New class:: freebsd supported.
        Fully qualified hostnames are truncated to remove the domain.
        i.e. if uname returns the FQN like in freebsd.

    1.2.25a
        Mount option changes for FreeBSD to avoid multiple mounts.
    1.2.26
        Bug fix for ! operator
        Source code rationalization
        (DEBIAN) Linux config improvements