~kim0/serverguide/serverguide-review-ch19

« back to all changes in this revision

Viewing changes to build/serverguide/C/etckeeper.html

  • Committer: Matthew East
  • Date: 2011-05-03 07:11:18 UTC
  • Revision ID: mdke@ubuntu.com-20110503071118-081aatibsr9k2yqy
Add files from ubuntu-docs natty branch, trim to use only those necessary for serverguide

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
<html xmlns="http://www.w3.org/1999/xhtml">
 
4
  <head xmlns="http://www.w3.org/1999/xhtml">
 
5
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
6
    <title xmlns="">etckeeper</title>
 
7
    <link rel="stylesheet" href="../../libs/ubuntu-book.css" type="text/css" />
 
8
    <link rel="home" href="index.html" title="Ubuntu Server Guide" />
 
9
    <link rel="up" href="other-useful-applications.html" title="Chapter 22. Other Useful Applications" />
 
10
    <link rel="prev" href="pam_motd.html" title="pam_motd" />
 
11
    <link rel="next" href="byobu.html" title="Byobu" />
 
12
    <link rel="copyright" href="legal.html" title="Credits and License" />
 
13
  </head>
 
14
  <body>
 
15
    <div id="round">
 
16
      <img id="topcap" alt="" src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-top.png" />
 
17
      <div id="layout" class="container clear-block">
 
18
        <script xmlns="" src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
 
19
        <script xmlns="" type="text/javascript">
 
20
_uacct = "UA-1018242-8";
 
21
urchinTracker();
 
22
</script>
 
23
        <div id="header">
 
24
          <div id="logo-floater">
 
25
            <h1>
 
26
              <a href="https://help.ubuntu.com" title="Ubuntu Documentation">
 
27
                <img alt="Ubuntu" id="logo" src="https://help.ubuntu.com/htdocs/ubuntunew/img/logo.png" />
 
28
              </a>
 
29
            </h1>
 
30
          </div>
 
31
          <noscript>
 
32
            <form action="http://www.google.com/cse" id="cse-search-box">
 
33
              <div>
 
34
                <input type="hidden" name="cx" value="003883529982892832976:e2vwumte3fq" />
 
35
                <input type="hidden" name="ie" value="UTF-8" />
 
36
                <input type="text" name="q" size="27" />
 
37
                <input type="submit" name="sa" value="Search" />
 
38
              </div>
 
39
            </form>
 
40
          </noscript>
 
41
          <script>
 
42
 document.write('<form action="https://help.ubuntu.com/search.html" id="cse-search-box">');
 
43
 document.write('  <div>');
 
44
 document.write('    <input type="hidden" name="cof" value="FORID:9" />');
 
45
 document.write('    <input type="hidden" name="cx" value="003883529982892832976:e2vwumte3fq" />');
 
46
 document.write('    <input type="hidden" name="ie" value="UTF-8" />');
 
47
 document.write('    <input type="text" name="q" size="27" />');
 
48
 document.write('    <input type="submit" name="sa" value="Search" />');
 
49
 document.write('  </div>');
 
50
 document.write('</form>');
 
51
</script>
 
52
          <div id="sitename">
 
53
            <a href="https://help.ubuntu.com/">
 
54
              <img alt="Official Documentation" src="https://help.ubuntu.com/htdocs/ubuntunew/img/help-about.png" />
 
55
              <span>Official Documentation</span>
 
56
            </a>
 
57
          </div>
 
58
        </div>
 
59
        <div id="page">
 
60
          <div id="content">
 
61
            <div class="breadcrumbs"><a href="https://help.ubuntu.com/">Ubuntu Documentation</a> &gt; <a href="https://help.ubuntu.com/11.04">Ubuntu 11.04</a> &gt; <span class="breadcrumb-link"><a href="index.html">Ubuntu Server Guide</a></span> &gt; <span class="breadcrumb-link"><a href="other-useful-applications.html">Other Useful Applications</a></span> &gt; <span class="breadcrumb-node">etckeeper</span></div>
 
62
            <div xmlns="http://www.w3.org/1999/xhtml" class="sect1" title="etckeeper">
 
63
              <div class="titlepage">
 
64
                <div>
 
65
                  <div>
 
66
                    <h2 class="title" style="clear: both"><a id="etckeeper"></a>etckeeper</h2>
 
67
                  </div>
 
68
                </div>
 
69
              </div>
 
70
              <p>
 
71
    <span class="application"><strong>etckeeper</strong></span> allows the contents of <code class="filename">/etc</code> be easily stored in 
 
72
    Version Control System (VCS) repository. It hooks into <span class="application"><strong>apt</strong></span> to automatically commit changes to
 
73
    <code class="filename">/etc</code> when packages are installed or upgraded.  Placing <code class="filename">/etc</code> under version control 
 
74
    is considered an industry best practice, and the goal of <span class="application"><strong>etckeeper</strong></span> is to make this process as 
 
75
    painless as possible.  
 
76
    </p>
 
77
              <p>
 
78
    Install <span class="application"><strong>etckeeper</strong></span> by entering the following in a terminal:
 
79
    </p>
 
80
              <pre class="screen">
 
81
<span class="command"><strong>sudo apt-get install etckeeper</strong></span>
 
82
</pre>
 
83
              <p>
 
84
    The main configuration file, <code class="filename">/etc/etckeeper/etckeeper.conf</code>, is fairly simple.  The main option is which
 
85
    VCS to use.  By default <span class="application"><strong>etckeeper</strong></span> is configured to use 
 
86
    <span class="application"><strong>bzr</strong></span> for version control.
 
87
    The repository is automatically initialized (and committed for the first
 
88
    time) during package installation. It is possible to undo this by entering
 
89
    the following command:
 
90
    </p>
 
91
              <pre class="screen">
 
92
<span class="command"><strong>sudo etckeeper uninit</strong></span>
 
93
</pre>
 
94
              <p>
 
95
    By default, etckeeper will commit uncommitted changes made to /etc daily.
 
96
    This can be disabled using the AVOID_DAILY_AUTOCOMMITS configuration
 
97
    option. It will also automatically commit changes before and after package
 
98
    installation. For a more precise tracking of changes, it is recommended
 
99
    to commit your changes manually, together with a commit message, using:
 
100
    </p>
 
101
              <pre class="screen">
 
102
<span class="command"><strong>sudo etckeeper commit "..Reason for configuration change.."</strong></span>
 
103
</pre>
 
104
              <p>
 
105
    Using the VCS commands you can view log information about files in <code class="filename">/etc</code>:
 
106
    </p>
 
107
              <pre class="screen">
 
108
<span class="command"><strong>sudo bzr log /etc/passwd</strong></span>
 
109
</pre>
 
110
              <p>
 
111
    To demonstrate the integration with the package management system, install <span class="application"><strong>postfix</strong></span>:
 
112
    </p>
 
113
              <pre class="screen">
 
114
<span class="command"><strong>sudo apt-get install postfix</strong></span>
 
115
</pre>
 
116
              <p>
 
117
    When the installation is finished, all the <span class="application"><strong>postfix</strong></span> configuration files should be committed to the
 
118
    repository:
 
119
    </p>
 
120
              <pre class="screen">
 
121
<code class="computeroutput">Committing to: /etc/
 
122
added aliases.db
 
123
modified group
 
124
modified group-
 
125
modified gshadow
 
126
modified gshadow-
 
127
modified passwd
 
128
modified passwd-
 
129
added postfix
 
130
added resolvconf
 
131
added rsyslog.d
 
132
modified shadow
 
133
modified shadow-
 
134
added init.d/postfix
 
135
added network/if-down.d/postfix
 
136
added network/if-up.d/postfix
 
137
added postfix/dynamicmaps.cf
 
138
added postfix/main.cf
 
139
added postfix/master.cf
 
140
added postfix/post-install
 
141
added postfix/postfix-files
 
142
added postfix/postfix-script
 
143
added postfix/sasl
 
144
added ppp/ip-down.d
 
145
added ppp/ip-down.d/postfix
 
146
added ppp/ip-up.d/postfix
 
147
added rc0.d/K20postfix
 
148
added rc1.d/K20postfix
 
149
added rc2.d/S20postfix
 
150
added rc3.d/S20postfix
 
151
added rc4.d/S20postfix
 
152
added rc5.d/S20postfix
 
153
added rc6.d/K20postfix
 
154
added resolvconf/update-libc.d
 
155
added resolvconf/update-libc.d/postfix
 
156
added rsyslog.d/postfix.conf
 
157
added ufw/applications.d/postfix
 
158
Committed revision 2.</code>
 
159
</pre>
 
160
              <p>
 
161
    For an example of how <span class="application"><strong>etckeeper</strong></span> tracks manual changes, add new a host to <code class="filename">/etc/hosts</code>.
 
162
    Using <span class="application"><strong>bzr</strong></span> you can see which files have been modified:
 
163
    </p>
 
164
              <pre class="screen">
 
165
<span class="command"><strong>sudo bzr status /etc/</strong></span>
 
166
<code class="computeroutput">modified:
 
167
  hosts</code>
 
168
</pre>
 
169
              <p>
 
170
    Now commit the changes:
 
171
    </p>
 
172
              <pre class="screen">
 
173
<span class="command"><strong>sudo etckeeper commit "new host"</strong></span>
 
174
</pre>
 
175
              <p>
 
176
    For more information on <span class="application"><strong>bzr</strong></span> see <a class="xref" href="bazaar.html" title="Bazaar">the section called “Bazaar”</a>.
 
177
    </p>
 
178
            </div>
 
179
          </div>
 
180
          <div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
 
181
            <hr />
 
182
            <table width="100%" summary="Navigation footer">
 
183
              <tr>
 
184
                <td width="40%" align="left"><a accesskey="p" href="pam_motd.html"><img src="../../libs/navig/prev.png" alt="Prev" /></a> </td>
 
185
                <td width="20%" align="center">
 
186
                  <a accesskey="u" href="other-useful-applications.html">
 
187
                    <img src="../../libs/navig/up.png" alt="Up" />
 
188
                  </a>
 
189
                </td>
 
190
                <td width="40%" align="right"> <a accesskey="n" href="byobu.html"><img src="../../libs/navig/next.png" alt="Next" /></a></td>
 
191
              </tr>
 
192
              <tr>
 
193
                <td width="40%" align="left" valign="top">pam_motd </td>
 
194
                <td width="20%" align="center">
 
195
                  <a accesskey="h" href="index.html">
 
196
                    <img src="../../libs/navig/home.png" alt="Home" />
 
197
                  </a>
 
198
                </td>
 
199
                <td width="40%" align="right" valign="top"> Byobu</td>
 
200
              </tr>
 
201
            </table>
 
202
          </div>
 
203
          <hr />
 
204
          <div id="footer">
 
205
            <div id="ubuntulinks">
 
206
              <p>The material in this document is available under a free license, see <a href="/legal.html">Legal</a> for details<br />
 
207
        For information on contributing see the <a href="https://wiki.ubuntu.com/DocumentationTeam">Ubuntu Documentation Team wiki page</a>. To report a problem, visit the <a href="https://bugs.launchpad.net/ubuntu/+source/ubuntu-docs">bug page for Ubuntu Documentation</a></p>
 
208
            </div>
 
209
          </div>
 
210
          <div id="bottomcap">
 
211
            <img src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-bottom.png" alt="" />
 
212
          </div>
 
213
        </div>
 
214
      </div>
 
215
    </div>
 
216
  </body>
 
217
</html>