xref: /openbsd-src/usr.sbin/sysmerge/sysmerge.8 (revision 6f05df2d9be0954bec42d51d943d77bd250fb664)
1.\"	$OpenBSD: sysmerge.8,v 1.68 2014/11/26 15:52:30 ajacoutot Exp $
2.\"
3.\" Copyright (c) 2008 Antoine Jacoutot <ajacoutot@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 26 2014 $
18.Dt SYSMERGE 8
19.Os
20.Sh NAME
21.Nm sysmerge
22.Nd update system configuration files
23.Sh SYNOPSIS
24.Nm
25.Bk -words
26.Op Fl bdp
27.Ek
28.Sh DESCRIPTION
29.Nm
30is a
31.Xr ksh 1
32script designed to help the administrator update configuration files
33after upgrading to a new release or snapshot.
34.Pp
35.Nm
36works by comparing a temporary reference root directory
37against currently installed files.
38All work is done under
39.Pa ${TMPDIR}/sysmerge.XXXXXXXXXX
40(known as the
41.Em work directory )
42which contains the temporary root directory
43.Pa temproot ,
44and the
45.Pa backup
46directory containing modified and/or replaced files.
47.Pp
48.Nm
49will work through the fileset,
50offering the chance to merge any differences using
51.Xr sdiff 1 .
52Merged files may be edited using the default editor or be left to deal
53with at a later date.
54Should any problems occur,
55such as a failure to upgrade a file,
56the user will be notified and will have to deal with the issue by hand.
57.Nm
58will also compare the checksum of each file stored under
59.Pa /etc/examples
60against the previous one then warn if it does not match and the
61corresponding file exists under
62.Pa /etc .
63.Pp
64By default (if
65.Fl d
66is not used)
67.Nm
68only compares files whose reference sources have changed since the last run
69and attempts to automatically upgrade them to the newest version,
70provided that they have no local changes.
71It automatically installs missing files and binaries,
72and updates files differing only by CVS Id.
73Files whose reference sources have matching CVS Id are skipped from comparison.
74.Pa /etc/fbtab
75and
76.Pa /etc/ttys
77are created using helper scripts and are
78.Sy always
79compared.
80Users and groups that are missing from the current installation but
81present in the new
82.Xr master.passwd 5
83and
84.Xr group 5
85files will
86.Sy always
87be automatically (re)created.
88.Pp
89.Nm
90will finish by running
91.Xr mtree 8
92to make sure the directory structure has correct permissions.
93.Pp
94The options are as follows:
95.Bl -tag -width Ds
96.It Fl b
97Batch mode.
98.Nm
99runs non-interactively,
100saving differing files for later manual processing.
101.It Fl d
102Diff mode.
103.Nm
104does not take any automatic action, allowing for a full diff comparison.
105.It Fl p
106Package mode.
107.Nm
108only compares the default configuration files of installed
109.Xr packages 7
110against their target on the system (@sample).
111.El
112.Pp
113Files can be excluded from comparison by listing them in
114.Pa /etc/sysmerge.ignore .
115The following files will always be skipped from direct comparison:
116.Pa /etc/group ,
117.Pa /etc/localtime ,
118.Pa /etc/mail/aliases.db ,
119.Pa /etc/master.passwd ,
120.Pa /etc/motd ,
121.Pa /etc/passwd ,
122.Pa /etc/pwd.db ,
123.Pa /etc/spwd.db ,
124.Pa /usr/share/sysmerge/etcsum ,
125.Pa /usr/share/sysmerge/examplessum ,
126.Pa /usr/share/sysmerge/xetcsum ,
127.Pa /var/db/locate.database ,
128.Pa /var/mail/root .
129.Sh ENVIRONMENT
130.Bl -tag -width "EDITORXXVISUAL"
131.It Ev EDITOR , VISUAL
132Specifies an editor to use.
133If both
134.Ev EDITOR
135and
136.Ev VISUAL
137are set,
138.Ev VISUAL
139takes precedence.
140If neither
141.Ev EDITOR
142nor
143.Ev VISUAL
144are set,
145the default is
146.Xr vi 1 .
147.It Ev PAGER
148Specifies the pagination program to use.
149.It Ev TMPDIR
150Directory in which the work directory is created.
151If unset, this defaults to
152.Pa /tmp .
153.El
154.Sh FILES
155.Bl -tag -width "${TMPDIR}/sysmerge.XXXXXXXXXX" -compact
156.It ${TMPDIR}/sysmerge.XXXXXXXXXX
157Default work directory.
158The
159.Sy temproot
160and
161.Sy backup
162directories are created relative to this.
163.It /etc/sysmerge.ignore
164Files and directories to ignore from comparison.
165.It /usr/share/sysmerge/etc.tgz
166Base system set containing the reference files
167corresponding to the currently installed release.
168.It /usr/share/sysmerge/xetc.tgz
169.Xr X 7
170set containing the reference files
171corresponding to the currently installed release.
172.El
173.Sh SEE ALSO
174.Xr more 1 ,
175.Xr sdiff 1
176.Pp
177.Lk http://www.openbsd.org/faq/current.html
178.Lk http://www.openbsd.org/faq/upgradeXX.html
179.Sh HISTORY
180The
181.Nm
182script first appeared in
183.Ox 4.4 .
184.Sh AUTHORS
185.An -nosplit
186.Nm
187was written by
188.An Antoine Jacoutot Aq Mt ajacoutot@openbsd.org .
189It was originally started as a friendly fork from
190mergemaster by
191.An Douglas Barton Aq Mt DougB@FreeBSD.org .
192