root/trunk/confman.8.in

Revision 503, 16.1 KB (checked in by ccowart, 10 months ago)

Documenting bugs.

Fixes #107

  • Property svn:keywords set to Id
Line 
1.\" Copyright (c) 2008, Christopher Cowart and contributors
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" * Redistributions of source code must retain the above copyright
8.\"   notice, this list of conditions and the following disclaimer.
9.\" * Redistributions in binary form must reproduce the above copyright
10.\"   notice, this list of conditions and the following disclaimer in the
11.\"   documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
19.\" TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20.\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24.\"
25.\" $Id$
26.\"
27.Dd May 06, 2009
28.Dt CONFMAN 8
29.Os
30.Sh NAME
31.Nm confman
32.Nd configuration file manager
33.Sh SYNOPSIS
34.Nm
35.Op Fl h | Cm help
36.Op Fl v | Cm version
37.Nm
38.Oo Ar flags Oc Ar command Oo Ar command_opts Oc Op Ar command_args
39.Sh DESCRIPTION
40The
41.Nm
42utility is designed to assist the System Administrator in managing
43configuration files by leveraging
44.Xr svn 1 .
45.Ss GLOSSARY
46.Bl -tag -width indent
47.It repository
48The repository refers to a subversion repository in which the history and
49current copies of files and their meta data are stored.
50.It filesystem
51The filesystem refers to the system on which
52.Nm
53is being invoked. The term "live filesystem" is a synonym for filesystem
54used for emphasis.
55.It working copy
56A
57.Nm
58working copy is a locally checked-out version of the repository. All changes
59are made locally in the working copy before being checked in and rolled out
60to the filesystem. The working copy defaults to "~/src/conf".
61.It module
62A module is a named set of files and directories that are managed in
63.Nm .
64Modules appear as top-level directories in your working copy. Within each
65module, managed files are laid out like the filesystem. For example, if
66you have a module named "ntpd" for your ntp servers, your working copy of
67"/etc/ntp.conf" would be "~/src/conf/ntpd/etc/ntp.conf".
68.It recipe
69A recipe is an ordered list of modules. Each host is configured to use
70exactly one recipe. The contents of each module are "layered on" the
71filesystem in order when committing changes to the filesystem. Thus copies
72of files from later modules will overwrite those from earlier modules.
73.Pp
74Blank lines and lines beginning with '#' are ignored in recipes. Recipe
75files should list one module per line.
76.It singularity
77A singularity is a file that is constructed from components in each module
78of the recipe. See the
79.Sx SINGULARITIES
80subsection of
81.Sx EXAMPLES
82for an example of how this works.
83.It state
84A system can either be in a dirty or clean state.
85A dirty system is one that has missed a
86.Xr confsync 8 operation in order to preserve changes made by installation
87operations occurring between the repository's
88.Xr confexport 8 and the invocation of
89.Cm confsync .
90.Pp
91Dirty systems may have out-of-date configuration files. Subsequent
92.Cm confsync
93or
94.Nm
95.Cm commit
96operations can bring the system up-to-date.
97.El
98.Ss FLAGS
99.Bl -tag -width "FLAGS "
100.It Global flags
101The following flags can be specified before the commands:
102.Bl -tag -width indent
103.It Fl h Op Ar command
104Synonymous to the
105.Ar help
106command below.
107.It Fl v
108Causes
109.Nm
110to print the version string and exit.
111.El
112.It Log flags
113The following flags can be used where
114.Ar log_flags
115appears in the usage statements (See
116.Sx COMMANDS ) :
117.Bl -tag -width indent
118.It Fl m Ar message
119The string in the
120.Ar message
121argument will be used instead of prompting the user for a log message for
122.Cm commit
123and
124.Cm install
125operations.
126.It Fl F Ar filename
127Like
128.Fl m ,
129except the log's contents are read from
130.Ar filename
131instead of the command line.
132.El
133.El
134.Ss COMMANDS
135The following commands are supported by
136.Nm :
137.Bl -tag -width indent
138.It Cm help [ Ar command ]
139With no argument, displays usage statement including supported commands.
140Specify a
141.Ar command
142for more detailed help.
143.It Cm setup
144The setup command is intended to be run the first time you use
145.Nm .
146It will check out your working copy. setup takes no additional arguments.
147.It Cm update [ Ar options ]
148The update command will update all the modules in your working copy. This
149Any options specified will be passed directly to
150.Xr svn 1 . This can be used
151for updating your working copy to an older revision.
152
153For example, you could use `confman update -r '{20090801}' www` to look at the
154state of the module named `www' as of 1 August 2009. This will re-add any
155deleted files and delete any added files from your working copy (This is
156simplest if you have commited any outstanding changes, but subversion is good
157about not deleting work-in-progress -- the errors can just be confusing).
158
159Note that before any install or commit operation, there is an implicit update
160that will cause the latest repository revision to be reflected in your working
161copy.  command does not alter the repository or the system.
162.It Cm commit Oo log_flags Oc
163The commit command causes your changes to take effect.
164.Bl -bullet
165.It
166Firstly, your working copy will be updated to prevent out-of-date
167conflicts and the installation of stale files.
168.It
169Secondly, your working copy for all of the modules in the current recipe
170will be committed back to the repository.
171.It
172Once
173.Nm
174is satisfied that all of your changes have been propagated to
175the repository, we will roll-out your working copy to the live filesystem.
176Every module appearing in the current recipe will be rolled out in the
177order they are listed.
178.El
179.It Cm diff [ Ar working_copy ]
180Displays the changes uncommitted changes in
181.Ar working_copy .
182.It Cm audit
183Shows differences between the working copy and the live filesystem.
184.It Cm log [ Ar working_copy ]
185Displays the log entires for the file or directory specified by
186.Ar working_copy .
187.It Cm create Ar module [ Ar module Ar ... ]
188Creates one or more modules for the
189.Ar module
190arguments provided.  New modules will appear in the top-level-directory of
191your working copy.  This change will also be committed to the repository
192at the same time.
193.It Cm rmmod Ar module [ Ar module Ar ... ]
194Delete the modules corresponding to the specified
195.Ar module
196arguments from your working copy. Follow this action with a revert or
197commit operation.
198.It Cm rename Ar oldmodule newmodule
199Rename
200.Ar oldmodule
201to
202.Ar newmodule ,
203updating all singularities and headers.
204.It Cm import Ar module Ar
205Add the specified files or directories from the live filesystem to your
206working copy of
207.Ar module .
208.It Cm install Oo Ar log_flags Oc Ar
209Roll out the specified working files and directories to the live filesystem.
210Note that recipe ordering will be respected, so using install in a low-priority
211module will still cause the highest priority module's copy of the file to
212ultimately be installed.
213.It Cm status Oo Ar working_copy Oc
214Look at the status entries for the file or directory specified by
215.Ar working_copy .
216.It Cm state
217This command indicates whether the system is "dirty" or "clean."
218.It Cm recipe
219.Brq Cm get | list
220.It Cm recipe create Oo Fl R Ar filename Oc Oo Ar log_flags Oc Ar recipe
221.It Cm recipe print Oo Ar recipe Oc
222.It Cm recipe edit Oo Ar log_flags Oc Oo Ar recipe Oc
223.It Cm recipe Bro Cm remove Brc Oo Ar log_flags Oc Ar recipe
224.It Cm recipe set Ar recipe
225.Bl -tag -width indent
226.It Cm create
227Create a recipe named
228.Ar recipe.
229Use -R to specify a file with the recipe's contents to bypass interactive
230mode.
231.It Cm edit
232Open
233.Ar recipe
234in a text editor
235.It Cm get
236Print the name of the host's current recipe
237.It Cm list
238List all recipes
239.It Cm print
240Display the contents of
241.Ar recipe .
242Defaults to the host's current recipe.
243.It Cm remove
244Delete
245.Ar recipe
246.It Cm set
247Configure this host to use
248.Ar recipe
249.El
250.It Cm ls Ar
251List files or directories in modified long form, including confman meta-data
252such as ownership and permissions.
253.It Cm lsattr Ar
254List out the confman attributes of files in the repository. These attributes
255can be used to store information such as file permissions, ownership, comment
256characters.
257.It Cm chattr Ar attr Ar value Ar
258Assign the attribute
259.Ar attr
260the value
261.Ar value
262for the
263.Ar file
264arguments provided.
265.It Cm rmattr Ar attr Ar
266Delete the attribute named
267.Ar attr
268from the
269.Ar file
270arguments specified.
271.It Cm rm Ar
272The remove subcommand removes a file from version control. It will NOT remove
273the file from the live filesystem.
274.It Cm cp Ar source destination
275Copy
276.Ar source
277to
278.Ar destination .
279Arguments must be working copies.
280.It Cm mv Ar source destination
281Rename
282.Ar source
283to
284.Ar destination .
285Arguments must be working copies.
286.It Cm link [ Fl f ] Ar target link_name
287The link command creates a symbolic link (See
288.Xr ln 1) pointing to the
289.Ar target
290file or directory. If
291.Ar link_name
292is a
293directory, the link will be created with the same
294.Xr basename 1 as
295.Ar target .
296The most common use of repository symlinks is to reconcile path differences
297between operatings systems. You can create freebsd/usr/local/etc/sudoers as
298a normal file. You can then create the link linux/etc/sudoers to point
299to the former file (in the freebsd module). This allows you to have a
300single copy of the file in different locations for different modules.
301.It Cm mkdir Ar directory
302Create a new version-controlled directory in your working copy. Parent
303directories do not have to exist; they will be created automatically. This
304command only affects your working copy. It does not commit the change.
305.It Cm revert Ar
306Restore the working copy files to the state before you began making edits.
307.It Cm chown [ Fl R ] Ar owner Ar
308Change the owner of working copy files.
309.Fl -R
310enables recursion. user:group notation is not yet supported.
311.It Cm chgrp [ Fl R ] Ar group Ar
312Change the group of working copy files. -R enables recursion.
313.It Cm chmod [ Fl R ] Ar mode Ar
314Change the permissions for the working copy files. -R enables recursion. Only
315octal permissions are supported (e.g., 0640 but not ug+rx).
316.It Cm chcom Ar string Ar
317.Nm
318stores the string that begins comments for a given file. This will be used
319to automatically generate confman headers on file installation in a future
320release. For now, this command exists in case confman guesses wrong.
321.It Cm chln Ar target link_name
322Update the simulated symlink, link_name, to point to target on the live
323filesystem. This works for "simulated" symlinks to files on the live
324filesystem, not on actual symlinks within your confman working copy.
325.It Cm checklook Ar module
326Peek into the checkpoints for the specified module and gives you a listing of
327current checkpoints with some other cool info.  This command does not alter the
328repository.
329.It Cm checknew Ar module name
330Create a named checkpoint for the specified module. This change is committed
331to the repository immediately.
332.It Cm checkclear Ar module name
333Clear a named checkpoint from the specified module. This change is committed
334to the repository immediately.
335.It Cm rollback Ar module [ checkpoint | YYYYMMDD [ HHMM ] ]
336Rolls your working copy of module back to the named checkpoint. You can
337optionally roll-back to a specific point in time using a date (and optionally
338time) as specified in the usage statement. A commit is made to the filesystem
339from the rolled back working copy.
340.El
341.Sh FILES
342.Bl -tag -width @sysconfdir@/confman.conf -compact
343.It Pa @sysconfdir@/confman.conf
344system-wide configurations for
345.Nm
346.It Pa ~/.confmanrc
347user-specific configurations for
348.Nm
349.El
350.Sh EXAMPLES
351This small set of examples should be enough to demonstrate some common use
352cases for new users. We assume a default working copy location of
353"~/src/conf", and paths in these examples will be relative to this directory.
354.Ss MODULES
355First, we will create a module named core:
356.Pp
357.Dl "confman create core"
358.Pp
359By convention, we will use the core module first in all of our recipes. This
360is the set of files that we generally want to be the same across all of our
361machines.
362.Pp
363There are some files that we are going to want to configure specifically
364for our server, marvin, so we'll create a module for those files too:
365.Pp
366.Dl "confman create marvin"
367.Ss RECIPES
368Now let's generate marvin's recipe:
369.Pp
370.Dl "confman recipe create marvin"
371.Pp
372The recipe opens in our text editor. We enter the following contents:
373.Pp
374.Dl "# Configurations common across all machines"
375.Dl "core"
376.Dl "# Configurations specific to marvin"
377.Dl "marvin"
378.Pp
379And we configure marvin to use the recipe named marvin:
380.Pp
381.Dl "confman recipe set marvin"
382.Ss WORKING WITH FILES
383Files have to be imported into
384.Nm
385before you can work with them:
386.Pp
387.Dl "confman import core /etc/resolv.conf"
388.Dl "confman import core /etc/periodic.conf"
389.Pp
390In order to make a change to /etc/resolv.conf, we will modify the working
391copy found in core/etc/resolv.conf. We'll add a domain to our
392search path. Next, we'll also make some changes to core/etc/periodic.conf.
393Once we're all set, we will commit our changes:
394.Pp
395.Dl "confman commit"
396.Pp
397The new versions of both files are checked into the repository and rolled
398out onto the filesystem. Note that these changes are now available in the
399repository for other servers to see, but until some action is taken, they
400will not be rolled out.
401.Ss SINGULARITIES
402Now let's assume that we have configured /etc/rc.conf as a singularity
403(See
404.Xr confman.conf 5) . We
405want to work with a global portion of the file in core and a host-specific
406portion of the file in our marvin module:
407.Pp
408.Dl "confman import core /etc/rc.conf"
409.Dl "confman import marvin /etc/rc.conf"
410.Pp
411We will put our globally relevant options in the core portion
412(core/etc/rc.conf-core):
413.Pp
414.Dl sshd_enable="YES"
415.Dl usbd_enable="YES"
416.Dl accounting_enable="YES"
417.Pp
418And our host-specific configurations in the marvin portion
419(marvin/etc/rc.conf-marvin):
420.Pp
421.Dl apache22_enable="YES"
422.Pp
423The resulting "/etc/rc.conf" that will be installed upon an install or commit
424operation is the concatenation of the pieces:
425.Pp
426.Dl sshd_enable="YES"
427.Dl usbd_enable="YES"
428.Dl accounting_enable="YES"
429.Dl apache22_enable="YES"
430.Sh SEE ALSO
431.Xr confman.conf 5 ,
432.Xr sudo 8 ,
433.Xr svn 1
434.Sh BUGS
435.Nm
436can be incredibly slow with large repositories. There are plans to cause
437working copies to only check out the modules relevant to the current system,
438but as yet this hasn't been completed.
439.Pp
440It should be assumed that
441.Nm
442will break in weird and mysterious ways if files or recipes have spaces in
443their names. While support for all filenames is an eventual goal, it has
444not been prioritized into any specific milestone.
445.Pp
446This release of
447.Nm
448has a known issue where filesystem symlinks will not commit on an install
449operation and require the use of commit. This issue should be resolved
450in the next major release of
451.Nm .
452.Sh SECURITY CONSIDERATIONS
453.Nm
454is intended to be run by a normal user and not by root. When needed,
455.Nm
456makes calls to
457.Xr sudo 8
458to escalate privileges. This only works if the user has full root access via
459the
460.Xr sudoers 5
461file. This model is designed to encourage individual accountability in an
462environment with several System Administrators; your own login is recorded
463in the subversion logs and recorded by sudo in the logs.
464.Pp
465While the typical use of
466.Nm
467has a shared repository for all of your machines, this may not make sense in
468all environments. Unless you are taking out-of-band measures to secure
469various directories in your subversion repository (possibly through the use
470of access control hooks), any account making changes to the repository can
471effect changes on other machines. It would generally be a good idea to only
472share a repository with machines in a similar security tier.
473.Sh AUTHORS
474.An Chris Cowart Aq ccowart@timesinks.net
Note: See TracBrowser for help on using the browser.