SYSMERGE(8)

NAME
sysmerge - update system configuration files

SYNOPSIS
sysmerge [-bd] [-s [src etcXX.tgz]] [-x xetcXX.tgz]

DESCRIPTION
sysmerge is a ksh(1) script designed to help the administrator update configuration files after upgrading to a new release or snapshot. The configuration files are typically those held in /etc, though sysmerge is also able to update files held in /dev, /root, and /var.

It is HIGHLY recommended to back up the /etc directory before running this script.

sysmerge works by comparing a temporary reference root directory against currently installed files. The reference files are created from a cvs(1) source tree or a “.tgz” release or snapshot file. The default, if no source is specified on the command line, is to use /usr/src. All work is done under ${TMPDIR}/sysmerge.XXXXXXXXXX (known as the work directory). The temporary root directory temproot is created under the work directory. Each modified and/or replaced file is saved under the backup directory inside the work directory.

To make sure configuration files are in sync with the actual binaries, use the same source as was used to upgrade the system: /usr/src when upgrading from source; etcXX.tgz and xetcXX.tgz when upgrading from binary sets.

sysmerge will work through the fileset, offering the chance to merge any differences using ${MERGE_CMD}. Merged files may be edited using a default editor, or one defined by the ${VISUAL} or ${EDITOR} environment variables. Files may also be left to deal with at a later date. Should any problems occur, such as a failure to upgrade a file, the user will be notified and have to deal with the issue by hand.

By default (if -d is not used) sysmerge only compares files whose reference sources have changed since the last run and attempts to automatically upgrade them to the newest version, provided that they have no local changes. It automatically installs missing files and binaries, and updates files differing only by CVS Id. Files whose reference sources have matching CVS Id are skipped from comparison. /etc/fbtab, /etc/login.conf, /etc/sysctl.conf, and /etc/ttys are created using helper scripts and are always compared. Users and groups that are missing from the current installation but present in the new master.passwd(5) and group(5) files will be automatically created.

sysmerge will finish by running mtree(8) to make sure the directory structure has correct permissions.

The options are as follows:

-b  Batch mode. sysmerge runs non-interactively, saving differing files for later manual processing.

-d  Diff mode. In this mode, sysmerge will not take any automatic action, allowing for a full diff comparison.

-s [src etcXX.tgz]
    Specify a path to an OpenBSD top src directory or an etcXX.tgz tarball. A tarball path specified as an FTP or HTTP URL will be passed to ${FETCH_CMD}.

-x xetcXX.tgz
    Specify a path to an xetcXX.tgz tarball. A tarball path specified as an FTP or HTTP URL will be passed to ${FETCH_CMD}.

Files and directories can be excluded from comparison by listing them in the file /etc/sysmerge.ignore, each entry separated by white space or a new line. The following files will always be skipped from comparison: /etc/*.db, /etc/mail/*.db, /etc/passwd, /etc/motd, /etc/myname, /var/db/locate.database, /var/db/sysmerge/etcsum, /var/db/sysmerge/xetcsum, /var/games/tetris.scores, /var/mail/root.

The sendmail(8) configuration files /etc/mail/localhost.cf, /etc/mail/sendmail.cf and /etc/mail/submit.cf will always differ because they include their build date and directories. A special test was added to handle this and they are offered for comparison only if they really differ.

ENVIRONMENT

DBDIR
    Directory in which checksum files are stored. If unset, this defaults to /var/db/sysmerge.

DESTDIR
    Directory in which to merge and install files. If unset, this defaults to /.

EDITOR, VISUAL
    Specifies an editor to use. If both EDITOR and VISUAL are set, VISUAL takes precedence. If neither EDITOR nor VISUAL are set, the default is vi(1).

FETCH_CMD
    Command used to fetch remote files. Defaults to ftp(1).

FTP_KEEPALIVE
    Have ftp(1) send a byte after every FTP_KEEPALIVE seconds, so that incorrectly configured network equipment won't aggressively drop it. See “ftp -k” for more information.

MERGE_CMD
    Command used to merge diffs. This will be called with three arguments: the first argument is the output file to create, the second argument is the currently installed file and the third argument is the reference file. If unset, this defaults to “sdiff -as -w ${SWIDTH} -o”.

PAGER
    Specifies the pagination program to use.

REPORT
    Log summary which may contain information for further, manual, updating. Defaults to ${WRKDIR}/sysmerge.log.

TMPDIR
    Directory in which the work directory is created. If unset, this defaults to /var/tmp.

FILES
${TMPDIR}/sysmerge.XXXXXXXXXX
    Default work directory. The temproot and backup directories are created relative to this.
${WRKDIR}/sysmerge.log
    Default log file.
/etc/sysmerge.ignore
    Files and directories to ignore from comparison.

SEE ALSO
cap_mkdb(1), chpass(1), diff(1), mktemp(1), more(1), sdiff(1), groupadd(8), MAKEDEV(8), makemap(8), mtree(8), newaliases(8), pwd_mkdb(8)

/usr/src/etc/Makefile

http://www.openbsd.org/faq/current.html http://www.openbsd.org/faq/upgradeXX.html

HISTORY
The sysmerge script first appeared in OpenBSD 4.4.

AUTHORS
-nosplit The sysmerge shell script was written by Antoine Jacoutot <ajacoutot@openbsd.org> using FreeBSD mergemaster written by Douglas Barton <DougB@FreeBSD.org> as a base.