source: branches/confman-1.9/confman.8.in @ 589

Revision 589, 16.7 KB checked in by blee, 5 months ago (diff)

Merge fix for #154 into confman-1.9.

Closes #154

  • 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 [ -a ] [ -r Ar revision_string ] [ Ar recipe ]
148The update command will update all the modules in your working copy by default,
149or, if given a Ar recipe, update all the files relevant to the given recipe.
150
151If the UPDATE_RELEVANT_ONLY flag has been set in
152.Xr confman.conf 5 ,
153the default behavior
154of Cm update is to update only the files relevant to the host's recipe. 
155The
156.Fl a
157flag will override this behavior and update the entire working copy.
158
159.Fl r Ar revision_string
160can be used, as in
161.Xr svn 1 ,
162to retrieve an older copy of the working copy, e.g.
163.Cm update -r PREV
164to retrieve the previous commit of the working copy.
165
166Note that before any install or commit operation, there is an implicit update
167that will cause the latest repository revision to be reflected in your working
168copy. This command does not alter the repository or the system.
169.It Cm commit Oo log_flags Oc
170The commit command causes your changes to take effect.
171.Bl -bullet
172.It
173Firstly, your working copy will be updated to prevent out-of-date
174conflicts and the installation of stale files.
175.It
176Secondly, your working copy for all of the modules in the current recipe
177will be committed back to the repository.
178.It
179Once
180.Nm
181is satisfied that all of your changes have been propagated to
182the repository, we will roll-out your working copy to the live filesystem.
183Every module appearing in the current recipe will be rolled out in the
184order they are listed.
185.El
186.It Cm diff [ Ar working_copy ]
187Displays the changes uncommitted changes in
188.Ar working_copy .
189.It Cm audit
190Shows differences between the working copy and the live filesystem.
191.It Cm log [ Ar working_copy ]
192Displays the log entires for the file or directory specified by
193.Ar working_copy .
194.It Cm create Ar module [ Ar module Ar ... ]
195Creates one or more modules for the
196.Ar module
197arguments provided.  New modules will appear in the top-level-directory of
198your working copy.  This change will also be committed to the repository
199at the same time.
200.It Cm rmmod Ar module [ Ar module Ar ... ]
201Delete the modules corresponding to the specified
202.Ar module
203arguments from your working copy. Follow this action with a revert or
204commit operation.
205.It Cm rename Ar oldmodule newmodule
206Rename
207.Ar oldmodule
208to
209.Ar newmodule ,
210updating all singularities and headers.
211.It Cm import Ar module Ar
212Add the specified files or directories from the live filesystem to your
213working copy of
214.Ar module .
215.It Cm install Oo Ar log_flags Oc Ar
216Roll out the specified working files and directories to the live filesystem.
217Note that recipe ordering will be respected, so using install in a low-priority
218module will still cause the highest priority module's copy of the file to
219ultimately be installed.
220.It Cm status Oo Ar working_copy Oc
221Look at the status entries for the file or directory specified by
222.Ar working_copy .
223.It Cm state
224This command indicates whether the system is "dirty" or "clean."
225.It Cm recipe
226.Brq Cm get | list
227.It Cm recipe create Oo Fl R Ar filename Oc Oo Ar log_flags Oc Ar recipe
228.It Cm recipe print Oo Ar recipe Oc
229.It Cm recipe edit Oo Ar log_flags Oc Oo Ar recipe Oc
230.It Cm recipe Bro Cm remove Brc Oo Ar log_flags Oc Ar recipe
231.It Cm recipe set Ar recipe
232.Bl -tag -width indent
233.It Cm create
234Create a recipe named
235.Ar recipe.
236Use -R to specify a file with the recipe's contents to bypass interactive
237mode.
238.It Cm edit
239Open
240.Ar recipe
241in a text editor
242.It Cm get
243Print the name of the host's current recipe
244.It Cm list
245List all recipes
246.It Cm print
247Display the contents of
248.Ar recipe .
249Defaults to the host's current recipe.
250.It Cm remove
251Delete
252.Ar recipe
253.It Cm set
254Configure this host to use
255.Ar recipe
256.El
257.It Cm ls Ar
258List files or directories in modified long form, including confman meta-data
259such as ownership and permissions.
260.It Cm lsattr Ar
261List out the confman attributes of files in the repository. These attributes
262can be used to store information such as file permissions, ownership, comment
263characters.
264.It Cm chattr Ar attr Ar value Ar
265Assign the attribute
266.Ar attr
267the value
268.Ar value
269for the
270.Ar file
271arguments provided.
272.It Cm rmattr Ar attr Ar
273Delete the attribute named
274.Ar attr
275from the
276.Ar file
277arguments specified.
278.It Cm rm Ar
279The remove subcommand removes a file from version control. It will NOT remove
280the file from the live filesystem.
281.It Cm cp Ar source destination
282Copy
283.Ar source
284to
285.Ar destination .
286Arguments must be working copies.
287.It Cm mv Ar source destination
288Rename
289.Ar source
290to
291.Ar destination .
292Arguments must be working copies.
293.It Cm link [ Fl f ] Ar target link_name
294The link command creates a symbolic link (See
295.Xr ln 1) pointing to the
296.Ar target
297file or directory. If
298.Ar link_name
299is a
300directory, the link will be created with the same
301.Xr basename 1 as
302.Ar target .
303The most common use of repository symlinks is to reconcile path differences
304between operatings systems. You can create freebsd/usr/local/etc/sudoers as
305a normal file. You can then create the link linux/etc/sudoers to point
306to the former file (in the freebsd module). This allows you to have a
307single copy of the file in different locations for different modules.
308.It Cm mkdir Ar directory
309Create a new version-controlled directory in your working copy. Parent
310directories do not have to exist; they will be created automatically. This
311command only affects your working copy. It does not commit the change.
312.It Cm touch Ar file
313Create a new version-controlled file in your working copy. Parent directories
314must exist. This command only affects your working copy. It does not commit the
315change.
316.It Cm revert Ar
317Restore the working copy files to the state before you began making edits.
318.It Cm chown [ Fl R ] Ar owner Ar
319Change the owner of working copy files.
320.Fl -R
321enables recursion. user:group notation is not yet supported.
322.It Cm chgrp [ Fl R ] Ar group Ar
323Change the group of working copy files. -R enables recursion.
324.It Cm chmod [ Fl R ] Ar mode Ar
325Change the permissions for the working copy files. -R enables recursion. Only
326octal permissions are supported (e.g., 0640 but not ug+rx).
327.It Cm chcom Ar string Ar
328.Nm
329stores the string that begins comments for a given file. This will be used
330to automatically generate confman headers on file installation in a future
331release. For now, this command exists in case confman guesses wrong.
332.It Cm chln Ar target link_name
333Update the simulated symlink, link_name, to point to target on the live
334filesystem. This works for "simulated" symlinks to files on the live
335filesystem, not on actual symlinks within your confman working copy.
336.It Cm checklook Ar module
337Peek into the checkpoints for the specified module and gives you a listing of
338current checkpoints with some other cool info.  This command does not alter the
339repository.
340.It Cm checknew Ar module name
341Create a named checkpoint for the specified module. This change is committed
342to the repository immediately.
343.It Cm checkclear Ar module name
344Clear a named checkpoint from the specified module. This change is committed
345to the repository immediately.
346.It Cm rollback Ar module [ checkpoint | YYYYMMDD [ HHMM ] ]
347Rolls your working copy of module back to the named checkpoint. You can
348optionally roll-back to a specific point in time using a date (and optionally
349time) as specified in the usage statement. A commit is made to the filesystem
350from the rolled back working copy.
351.El
352.Sh FILES
353.Bl -tag -width @sysconfdir@/confman.conf -compact
354.It Pa @sysconfdir@/confman.conf
355system-wide configurations for
356.Nm
357.It Pa ~/.confmanrc
358user-specific configurations for
359.Nm
360.El
361.Sh EXAMPLES
362This small set of examples should be enough to demonstrate some common use
363cases for new users. We assume a default working copy location of
364"~/src/conf", and paths in these examples will be relative to this directory.
365.Ss MODULES
366First, we will create a module named core:
367.Pp
368.Dl "confman create core"
369.Pp
370By convention, we will use the core module first in all of our recipes. This
371is the set of files that we generally want to be the same across all of our
372machines.
373.Pp
374There are some files that we are going to want to configure specifically
375for our server, marvin, so we'll create a module for those files too:
376.Pp
377.Dl "confman create marvin"
378.Ss RECIPES
379Now let's generate marvin's recipe:
380.Pp
381.Dl "confman recipe create marvin"
382.Pp
383The recipe opens in our text editor. We enter the following contents:
384.Pp
385.Dl "# Configurations common across all machines"
386.Dl "core"
387.Dl "# Configurations specific to marvin"
388.Dl "marvin"
389.Pp
390And we configure marvin to use the recipe named marvin:
391.Pp
392.Dl "confman recipe set marvin"
393.Ss WORKING WITH FILES
394Files have to be imported into
395.Nm
396before you can work with them:
397.Pp
398.Dl "confman import core /etc/resolv.conf"
399.Dl "confman import core /etc/periodic.conf"
400.Pp
401In order to make a change to /etc/resolv.conf, we will modify the working
402copy found in core/etc/resolv.conf. We'll add a domain to our
403search path. Next, we'll also make some changes to core/etc/periodic.conf.
404Once we're all set, we will commit our changes:
405.Pp
406.Dl "confman commit"
407.Pp
408The new versions of both files are checked into the repository and rolled
409out onto the filesystem. Note that these changes are now available in the
410repository for other servers to see, but until some action is taken, they
411will not be rolled out.
412.Ss SINGULARITIES
413Now let's assume that we have configured /etc/rc.conf as a singularity
414(See
415.Xr confman.conf 5) . We
416want to work with a global portion of the file in core and a host-specific
417portion of the file in our marvin module:
418.Pp
419.Dl "confman import core /etc/rc.conf"
420.Dl "confman import marvin /etc/rc.conf"
421.Pp
422We will put our globally relevant options in the core portion
423(core/etc/rc.conf-core):
424.Pp
425.Dl sshd_enable="YES"
426.Dl usbd_enable="YES"
427.Dl accounting_enable="YES"
428.Pp
429And our host-specific configurations in the marvin portion
430(marvin/etc/rc.conf-marvin):
431.Pp
432.Dl apache22_enable="YES"
433.Pp
434The resulting "/etc/rc.conf" that will be installed upon an install or commit
435operation is the concatenation of the pieces:
436.Pp
437.Dl sshd_enable="YES"
438.Dl usbd_enable="YES"
439.Dl accounting_enable="YES"
440.Dl apache22_enable="YES"
441.Sh SEE ALSO
442.Xr confman.conf 5 ,
443.Xr sudo 8 ,
444.Xr svn 1
445.Sh BUGS
446.Nm
447can be incredibly slow with large repositories. There are plans to cause
448working copies to only check out the modules relevant to the current system,
449but as yet this hasn't been completed.
450.Pp
451It should be assumed that
452.Nm
453will break in weird and mysterious ways if files or recipes have spaces in
454their names. While support for all filenames is an eventual goal, it has
455not been prioritized into any specific milestone.
456.Pp
457This release of
458.Nm
459has a known issue where filesystem symlinks will not commit on an install
460operation and require the use of commit. This issue should be resolved
461in the next major release of
462.Nm .
463.Pp
464If you are managing your
465.Xr confman.conf 5
466file in
467.Nm ,
468the process of changing a file to become a singularity requires two commits;
469the first to get the new confman.conf onto the filesystem and the second to
470actually install the pieces as a unit. A redesign for how singularity
471metadata is stored is planned for the next major release.
472.Sh SECURITY CONSIDERATIONS
473.Nm
474is intended to be run by a normal user and not by root. When needed,
475.Nm
476makes calls to
477.Xr sudo 8
478to escalate privileges. This only works if the user has full root access via
479the
480.Xr sudoers 5
481file. This model is designed to encourage individual accountability in an
482environment with several System Administrators; your own login is recorded
483in the subversion logs and recorded by sudo in the logs.
484.Pp
485While the typical use of
486.Nm
487has a shared repository for all of your machines, this may not make sense in
488all environments. Unless you are taking out-of-band measures to secure
489various directories in your subversion repository (possibly through the use
490of access control hooks), any account making changes to the repository can
491effect changes on other machines. It would generally be a good idea to only
492share a repository with machines in a similar security tier.
493.Sh AUTHORS
494.An Chris Cowart Aq ccowart@timesinks.net
Note: See TracBrowser for help on using the repository browser.