ETCUPDATE(8) | System Manager's Manual | ETCUPDATE(8) |
etcupdate
—
etcupdate |
[-ahlv ] [-d
destdir] [-p
pager] [-s
{srcdir | tgzdir |
tgzfile}] [-t
temproot] [-w
width] |
etcupdate
is a tool that lets the administrator update
the configuration and startup files in /etc (and some
other directories like /dev,
/root and /var) 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
make build in /usr/src or
after extracting new binary distribution files) to update to the latest
configuration and startup files.
etcupdate
compares the new configuration
files against the currently installed files. The user is given the option of
installing, merging or deleting each modified or missing file. The user can
also view the differences between the files. By default, it shows the
differences in the unified diff format. The default format can be toggled to
show the differences in unified, context, or side by side formats or an
user-defined command may be used to view differences. (And if
wdiff
is installed, it can also show differences on
a word by word basis.)
etcupdate
also detects if the user
installs certain special files and performs corresponding tasks like
remaking device nodes or rebuilding a database from the
aliases(5) file. Finally,
etcupdate
runs
postinstall(8) to check
the results.
etcupdate
needs a clean set of new
configuration files to compare the existing files against. These files,
called the “reference files” in this manual, may be derived
from either a source or binary distribution of
NetBSD.
If the user is updating from sources (which is the default mode),
etcupdate
will first create a copy of the reference
files by running make distribution in
/usr/src/etc, installing the files to a so-called
temproot. (See usage of the
-s
srcdir and
-t
temproot options later in
this manual page.) Although this is the default mode, it is not recommended
(see the “BUGS” section).
Instead of using sources, it is recommended that the user should
extract one or more binary distribution sets in a special location and use
those as the reference files (see usage of the -s
tgzdir option later in this manual page), or specify
one or more binary distribution sets directly (see usage of the
-s
tgzfile option later in
this manual page).
The following options are available:
-a
etcupdate
can automatically update files which
have not been modified locally. The -a
flag
instructs etcupdate
to store MD5 checksums in
/var/etcupdate and use these checksums to
determine if there have been any local modifications.-d
destdir-h
-l
-a
flag
described above.-p
pagerPAGER
variable.-s
{srcdir | tgzdir |
tgzfile}-s
srcdirSRCDIR
variable. The reference files will be
created by running “make distribution” in the
srcdir/etc directory.
Note that srcdir should refer to the top of the
source directory tree; earlier versions of
etcupdate
expected
srcdir to refer to the
etc subdirectory within the source tree.-s
tgzdir-s
tgzfile-s
options may be used to specify multiple set
files. The “etc.tgz” or
“etc.tar.xz” set file must be
specified. The “xetc.tgz” or
“xetc.tar.xz” set file is
optional.-t
temproot-s
srcdir, or a temporary copy of the reference files
extracted from the binary sets specified by -s
tgzfile, or a temporary copy of the reference files
from the directory specified by -s
tempdir. By default this is
/tmp/temproot but can be changed either with this
option or the TEMPROOT
environment variable.-v
etcupdate
verbose about its actions.-w
widthWIDTH
variable. This is useful for
xterm(1) users with wider
shell windows.TEMPROOT
-t
above.SRCDIR
-s
above.PAGER
-p
above.WIDTH
-w
above.IGNOREFILES
etcupdate
should ignore.
Files listed in this variable will never be considered for updating by
etcupdate
./etc/etcupdate.conf
~/.etcupdaterc
etcupdate
The default location of the source files is
/usr/src but this may be overridden with the
-s
srcdir command line
argument:
etcupdate -s
/some/where/src
To update the configuration files from binary distribution sets do something like this:
etcupdate -s /some/where/etc.tgz -s
/some/where/xetc.tgz
or like this:
mkdir /tmp/temproot
cd /tmp/temproot
tar -xpzf
/some/where/etc.tgz
tar -xpzf
/some/where/xetc.tgz
etcupdate -s
/tmp/temproot
You have modified only few files in the /etc directory so you would like install most of the updates without being asked. To automatically update the unmodified configuration files:
etcupdate -a
To get a better idea what's going on, use the
-v
flag:
etcupdate -v
etcupdate
command appeared in
NetBSD 1.6.
In NetBSD 4.0, the
-s
tgzfile option was added,
the -b
tempdir option was
converted to -s
tgzdir, and
the -s
srcdir option was
changed to refer to the top of the source directory tree rather than to the
etc subdirectory.
In NetBSD 5.0, the ability to specify
multiple colon-separated files with a single -s
option was deprecated, and options deprecated in NetBSD
4.0 were removed.
In NetBSD 7.0, the ability to specify
multiple colon-separated files with a single -s
option was removed (multiple -s
options must be used
instead), and the -d
destdir
option was added.
The idea for this script (including code fragments, variable names etc.) came from the FreeBSD mergemaster (by Douglas Barton). Unlike the FreeBSD mergemaster, this does not use CVS version tags by default to compare if the files need to be updated. Files are compared with cmp(1) as this is more reliable and the only way if the version numbers are the same even though the files are different.
-s
srcdir” option (or if the
/usr/src directory is used by default), then
etcupdate
will run “make distribution”
in the etc subdirectory of the source directory, but
it will not use the same options or environment variables that would be used
during a full build of the operating system. For this reason, use of the
“-s
srcdir” option
is not recommended, and use of the “-s
tgzdir” or “-s
tgzfile” options is recommended.
November 20, 2018 | NetBSD 9.4 |