etckeeper Other Useful Applications

381

2. etckeeper

etckeeper allows the contents of etc be easily stored in Version Control System VCS repository. It hooks into apt to automatically commit changes to etc when packages are installed or upgraded. Placing etc under version control is considered an industry best practice, and the goal of etckeeper is to make this process as painless as possible. Install etckeeper by entering the following in a terminal: sudo apt-get install etckeeper The main configuration file, etcetckeeperetckeeper.conf , is fairly simple. The main option is which VCS to use. By default etckeeper is configured to use bzr for version control. The repository is automatically initialized and committed for the first time during package installation. It is possible to undo this by entering the following command: sudo etckeeper uninit By default, etckeeper will commit uncommitted changes made to etc daily. This can be disabled using the AVOID_DAILY_AUTOCOMMITS configuration option. It will also automatically commit changes before and after package installation. For a more precise tracking of changes, it is recommended to commit your changes manually, together with a commit message, using: sudo etckeeper commit ..Reason for configuration change.. Using the VCS commands you can view log information about files in etc : sudo bzr log etcpasswd To demonstrate the integration with the package management system, install postfix: sudo apt-get install postfix When the installation is finished, all the postfix configuration files should be committed to the repository: Committing to: etc added aliases.db modified group modified group- modified gshadow modified gshadow- modified passwd modified passwd- added postfix 382 added resolvconf added rsyslog.d modified shadow modified shadow- added init.dpostfix added networkif-down.dpostfix added networkif-up.dpostfix added postfixdynamicmaps.cf added postfixmain.cf added postfixmaster.cf added postfixpost-install added postfixpostfix-files added postfixpostfix-script added postfixsasl added pppip-down.d added pppip-down.dpostfix added pppip-up.dpostfix added rc0.dK20postfix added rc1.dK20postfix added rc2.dS20postfix added rc3.dS20postfix added rc4.dS20postfix added rc5.dS20postfix added rc6.dK20postfix added resolvconfupdate-libc.d added resolvconfupdate-libc.dpostfix added rsyslog.dpostfix.conf added ufwapplications.dpostfix Committed revision 2. For an example of how etckeeper tracks manual changes, add new a host to etchosts . Using bzr you can see which files have been modified: sudo bzr status etc modified: hosts Now commit the changes: sudo etckeeper commit new host For more information on bzr see Section 1, “Bazaar” [p. 267]. 383

3. Byobu