2003-04-02 23:30:57 +04:00
|
|
|
.\" $NetBSD: etcupdate.8,v 1.10 2003/04/02 19:30:57 wiz Exp $
|
2002-03-22 13:10:56 +03:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Martti Kuparinen.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2003-04-02 20:47:40 +04:00
|
|
|
.Dd April 2, 2003
|
2002-03-22 13:10:56 +03:00
|
|
|
.Dt ETCUPDATE 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm etcupdate
|
|
|
|
.Nd update the configuration and startup files in
|
|
|
|
.Pa /etc
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2003-04-02 23:30:57 +04:00
|
|
|
.Op Fl ahlv
|
2002-03-22 13:10:56 +03:00
|
|
|
.Op Fl b Ar srcdir
|
|
|
|
.Op Fl p Ar pager
|
|
|
|
.Op Fl s Ar srcdir
|
|
|
|
.Op Fl t Ar temproot
|
|
|
|
.Op Fl w Ar width
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2003-04-02 20:47:40 +04:00
|
|
|
is a tool that lets the administrator update the configuration and
|
|
|
|
startup files in
|
2002-03-22 13:10:56 +03:00
|
|
|
.Pa /etc
|
|
|
|
(and some other directories like
|
|
|
|
.Pa /dev ,
|
|
|
|
.Pa /root
|
|
|
|
and
|
|
|
|
.Pa /var )
|
2003-04-02 20:47:40 +04:00
|
|
|
without having to manually check and modify every file.
|
|
|
|
The administrator should run this script after performing an operating
|
|
|
|
system update (e.g. after running
|
2002-03-22 13:10:56 +03:00
|
|
|
.Pa make build
|
|
|
|
in
|
|
|
|
.Pa /usr/src
|
2003-04-02 20:47:40 +04:00
|
|
|
or after extracting new binary distribution files)
|
|
|
|
to update to the latest configuration and startup files.
|
2002-03-22 13:10:56 +03:00
|
|
|
.Pp
|
|
|
|
.Nm
|
2003-04-02 20:47:40 +04:00
|
|
|
compares the new configuration files against the currently installed files.
|
2002-03-22 13:10:56 +03:00
|
|
|
The user is given the option of installing, merging or deleting each
|
|
|
|
modified or missing file.
|
|
|
|
.Nm
|
|
|
|
also detects if the user installs certain special files and performs
|
|
|
|
corresponding tasks like remaking device nodes or rebuilding a database
|
|
|
|
from the
|
|
|
|
.Xr aliases 5
|
|
|
|
file.
|
2003-01-24 16:06:06 +03:00
|
|
|
.Pp
|
|
|
|
.Nm
|
2003-04-02 23:30:57 +04:00
|
|
|
needs a clean set of new configuration files to compare the
|
2003-04-02 20:47:40 +04:00
|
|
|
existing files against.
|
|
|
|
These files, called the
|
|
|
|
.Dq reference files
|
|
|
|
in this manual, may be derived from either a source or binary
|
|
|
|
distribution of
|
|
|
|
.Nx .
|
|
|
|
.Pp
|
|
|
|
If the user is updating from sources (which is the default mode),
|
|
|
|
.Nm
|
|
|
|
will first create a copy of the reference files
|
|
|
|
by running
|
|
|
|
.Pa make distribution
|
|
|
|
in
|
|
|
|
.Pa /usr/src/etc ,
|
|
|
|
installing the files to a so-called
|
|
|
|
.Pa temproot .
|
|
|
|
(See usage of the
|
2003-04-02 23:30:57 +04:00
|
|
|
.Fl s Ar srcdir
|
2003-04-02 20:47:40 +04:00
|
|
|
and
|
|
|
|
.Fl t Ar temproot
|
|
|
|
options later in this manual page.)
|
|
|
|
.Pp
|
|
|
|
Instead of using sources, the user can also extract one or more binary
|
|
|
|
distribution sets in a special location and use those as the reference
|
|
|
|
files (see usage of the
|
|
|
|
.Fl b Ar srcdir
|
|
|
|
option later in this manual page).
|
|
|
|
.Pp
|
|
|
|
The following options are available:
|
2003-04-02 23:30:57 +04:00
|
|
|
.Bl -tag -width XXtXtemprootX
|
2003-04-02 20:47:40 +04:00
|
|
|
.It Fl a
|
|
|
|
.Nm
|
2003-01-24 16:06:06 +03:00
|
|
|
can automatically update files which have not been modified locally.
|
|
|
|
The
|
|
|
|
.Fl a
|
|
|
|
flag instructs
|
|
|
|
.Nm
|
|
|
|
to store MD5 checksums in
|
2003-03-03 17:07:11 +03:00
|
|
|
.Pa /var/etcupdate
|
2003-01-24 16:08:22 +03:00
|
|
|
and use these checksums to determine if there have been any
|
2003-01-24 16:06:06 +03:00
|
|
|
local modifications.
|
2003-04-02 23:30:57 +04:00
|
|
|
.It Fl b Ar srcdir
|
2003-04-02 20:47:40 +04:00
|
|
|
Location of reference files extracted from a binary distribution of
|
|
|
|
.Nx .
|
|
|
|
Note that reference files in
|
|
|
|
.Pa srcdir
|
|
|
|
will be altered and removed by
|
2003-04-02 07:07:30 +04:00
|
|
|
.Nm
|
2003-04-02 20:47:40 +04:00
|
|
|
when using the
|
|
|
|
.Fl b Ar srcdir
|
|
|
|
option (as the
|
|
|
|
.Pa srcdir
|
|
|
|
directory is treated like
|
|
|
|
.Pa temproot ) .
|
|
|
|
.It Fl h
|
|
|
|
Prints a help text.
|
|
|
|
.It Fl l
|
|
|
|
Automatically skip files with unchanged RCS IDs.
|
|
|
|
This has the effect of leaving alone files that have been altered
|
2003-04-02 23:30:57 +04:00
|
|
|
locally but which have not been changed in the
|
2003-04-02 20:47:40 +04:00
|
|
|
reference files.
|
|
|
|
Since this works using RCS IDs, files without RCS IDs will not be
|
|
|
|
skipped even if only modified locally.
|
2003-04-02 07:07:30 +04:00
|
|
|
This flag may be used together with the
|
|
|
|
.Fl a
|
|
|
|
flag described above.
|
2003-04-02 23:30:57 +04:00
|
|
|
.It Fl p Ar pager
|
2003-04-02 20:47:40 +04:00
|
|
|
The pager to use when displaying files.
|
2003-03-17 11:19:22 +03:00
|
|
|
By default this is
|
2003-04-02 20:47:40 +04:00
|
|
|
.Xr more 1
|
|
|
|
but it can be changed either with this option
|
|
|
|
or by defining the
|
|
|
|
.Ev PAGER
|
2002-03-22 13:10:56 +03:00
|
|
|
variable.
|
2003-04-02 23:30:57 +04:00
|
|
|
.It Fl s Ar srcdir
|
2002-03-22 13:10:56 +03:00
|
|
|
The location of the
|
|
|
|
.Nx
|
2003-04-02 20:47:40 +04:00
|
|
|
sources files used to create the reference files.
|
2003-03-17 11:19:22 +03:00
|
|
|
By default this is
|
2002-03-22 13:10:56 +03:00
|
|
|
.Pa /usr/src/etc
|
2003-04-02 20:47:40 +04:00
|
|
|
but it can be changed either with this option
|
|
|
|
or the
|
2002-03-22 13:10:56 +03:00
|
|
|
.Ev SRCDIR
|
|
|
|
variable.
|
2003-04-02 23:30:57 +04:00
|
|
|
.It Fl t Ar temproot
|
2003-04-02 20:47:40 +04:00
|
|
|
Specifies the location of the
|
|
|
|
.Pa temproot
|
|
|
|
directory.
|
|
|
|
The temporary reference files created from
|
|
|
|
.Pa /usr/src/etc
|
|
|
|
will be stored there.
|
2003-02-14 19:11:34 +03:00
|
|
|
By default this is
|
2003-04-02 20:47:40 +04:00
|
|
|
.Pa /tmp/temproot
|
|
|
|
but can be changed either with this option or the
|
|
|
|
.Ev TEMPROOT
|
|
|
|
environment variable.
|
|
|
|
.It Fl v
|
|
|
|
Makes
|
|
|
|
.Nm
|
|
|
|
verbose about its actions.
|
2003-04-02 23:30:57 +04:00
|
|
|
.It Fl w Ar width
|
2003-04-02 20:47:40 +04:00
|
|
|
Sets screen width used during interactive merge.
|
|
|
|
By default this is the number of columns
|
|
|
|
.Xr stty 1
|
|
|
|
reports but it can be changed either with this
|
|
|
|
option or by defining the
|
2002-03-22 13:10:56 +03:00
|
|
|
.Ev WIDTH
|
|
|
|
variable.
|
|
|
|
This is useful for
|
|
|
|
.Xr xterm 1
|
|
|
|
users with wider shell windows.
|
2003-04-02 20:47:40 +04:00
|
|
|
.El
|
|
|
|
.Sh ENVIRONMENT
|
2003-04-02 23:30:57 +04:00
|
|
|
.Bl -tag -width IGNOREFILESXX
|
2003-04-02 20:47:40 +04:00
|
|
|
.It Ev TEMPROOT
|
|
|
|
Sets a default value for
|
|
|
|
.Pa temproot .
|
|
|
|
See
|
|
|
|
.Fl t
|
|
|
|
above.
|
|
|
|
.It Ev SRCDIR
|
|
|
|
The location of the
|
|
|
|
.Nx
|
|
|
|
sources files.
|
|
|
|
See
|
|
|
|
.Fl s
|
|
|
|
above.
|
|
|
|
.It Ev PAGER
|
|
|
|
The pager to use when displaying files.
|
|
|
|
See
|
|
|
|
.Fl p
|
|
|
|
above.
|
|
|
|
.It Ev WIDTH
|
|
|
|
The screen width used during interactive merge.
|
|
|
|
See
|
|
|
|
.Fl w
|
|
|
|
above.
|
2003-03-01 15:59:54 +03:00
|
|
|
.It Ev IGNOREFILES
|
|
|
|
A list of files that
|
|
|
|
.Nm
|
2003-03-17 11:19:22 +03:00
|
|
|
should ignore.
|
|
|
|
Files listed in this
|
2003-03-01 15:59:54 +03:00
|
|
|
variable will never be considered for updating by
|
|
|
|
.Nm .
|
2002-03-22 13:10:56 +03:00
|
|
|
.El
|
|
|
|
.Sh FILES
|
|
|
|
The environment variables can also be defined in the following configuration
|
2003-02-14 19:11:34 +03:00
|
|
|
files.
|
|
|
|
The user's personal configuration file settings override the global
|
2002-03-22 13:10:56 +03:00
|
|
|
settings.
|
|
|
|
.Pp
|
|
|
|
/etc/etcupdate.conf
|
|
|
|
.Pp
|
|
|
|
~/.etcupdaterc
|
|
|
|
.Sh EXAMPLES
|
|
|
|
You have just upgraded your
|
|
|
|
.Nx
|
|
|
|
host from 1.6 to 1.6.1 and now it's time
|
|
|
|
to update the configuration files as well.
|
|
|
|
To update the configuration files from the sources (if you have the
|
|
|
|
.Pa /usr/src/etc
|
|
|
|
directory):
|
|
|
|
.Pp
|
|
|
|
.Dl etcupdate
|
|
|
|
.Pp
|
|
|
|
The default location of the source files is
|
|
|
|
.Pa /usr/src/etc
|
|
|
|
but this may be overridden with the
|
|
|
|
.Fl s Ar srcdir
|
|
|
|
command line argument:
|
|
|
|
.Pp
|
|
|
|
.Dl etcupdate -s /some/where/src/etc
|
|
|
|
.Pp
|
|
|
|
To update the configuration files from binary distribution sets
|
|
|
|
do something like this:
|
|
|
|
.Pp
|
|
|
|
.Dl mkdir /tmp/temproot
|
|
|
|
.Dl cd /tmp/temproot
|
|
|
|
.Dl tar xpzf /some/where/etc.tgz
|
|
|
|
.Dl etcupdate -b /tmp/temproot
|
|
|
|
.Pp
|
2003-01-24 16:06:06 +03:00
|
|
|
You have modified only few files in the
|
|
|
|
.Pa /etc
|
|
|
|
directory so you would like install most of the updates without being asked.
|
|
|
|
To automatically update the unmodified configuration files:
|
|
|
|
.Pp
|
|
|
|
.Dl etcupdate -a
|
|
|
|
.Pp
|
2002-03-22 13:10:56 +03:00
|
|
|
To get a better idea what's going on, use the
|
|
|
|
.Fl v
|
|
|
|
flag:
|
|
|
|
.Pp
|
|
|
|
.Dl etcupdate -v
|
2003-04-02 20:47:40 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr cmp 1 ,
|
|
|
|
.Xr more 1 ,
|
|
|
|
.Xr rcs 1 ,
|
|
|
|
.Xr sdiff 1 ,
|
|
|
|
.Xr stty 1 ,
|
|
|
|
.Xr aliases 5
|
2002-03-22 13:10:56 +03:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command appeared in
|
|
|
|
.Nx 1.6 .
|
|
|
|
.Sh AUTHORS
|
2003-02-14 19:11:34 +03:00
|
|
|
The script was written by
|
|
|
|
.An Martti Kuparinen
|
|
|
|
.Aq martti@NetBSD.org
|
|
|
|
and improved by several other
|
2002-03-22 13:10:56 +03:00
|
|
|
.Nx
|
|
|
|
users.
|
|
|
|
.Pp
|
|
|
|
The idea for this script (including code fragments, variable names etc.)
|
|
|
|
came from the
|
|
|
|
.Fx
|
2003-02-14 19:11:34 +03:00
|
|
|
mergemaster (by Douglas Barton).
|
|
|
|
Unlike the
|
2002-03-22 13:10:56 +03:00
|
|
|
.Fx
|
2003-04-02 20:47:40 +04:00
|
|
|
mergemaster, this does not use CVS version tags by default to compare if
|
2003-02-14 19:11:34 +03:00
|
|
|
the files need to be updated.
|
|
|
|
Files are compared with
|
2002-03-22 13:10:56 +03:00
|
|
|
.Xr cmp 1
|
|
|
|
as this is more reliable and the only way if the version numbers are the
|
|
|
|
same even though the files are different.
|
2003-03-01 15:59:54 +03:00
|
|
|
.\" when exactly are the version the same even though the file changes?
|
|
|
|
.\" .Pp
|
|
|
|
.\" .Sh BUGS
|
|
|
|
.\" Because of the use of
|
|
|
|
.\" .Xr cmp 1
|
|
|
|
.\" to compare files, rather than CVS versions, files that are locally changed
|
|
|
|
.\" from the distribution are always considered needing to be updated.
|