1.\" $OpenBSD: sysmerge.8,v 1.71 2015/08/24 11:03:41 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: August 24 2015 $ 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 . 44.Pp 45.Nm 46will work through the fileset, 47offering the chance to merge any differences using 48.Xr sdiff 1 . 49Merged files may be edited using the default editor or be left to deal 50with at a later date. 51Should any problems occur, 52such as a failure to upgrade a file, 53the user will be notified and will have to deal with the issue by hand. 54.Nm 55will also compare the checksum of each file stored under 56.Pa /etc/examples 57against the previous one then warn if it does not match and the 58corresponding file exists under 59.Pa /etc . 60.Pp 61By default (if 62.Fl d 63is not used) 64.Nm 65only compares files whose reference sources have changed since the last run 66and attempts to automatically upgrade them to the newest version, 67provided that they have no local changes. 68It automatically installs missing files and binaries, 69and updates files differing only by CVS Id. 70Files whose reference sources have matching CVS Id are skipped from comparison. 71.Pa /etc/fbtab 72and 73.Pa /etc/ttys 74are created using helper scripts and are 75.Sy always 76compared. 77Users and groups that are missing from the current installation but 78present in the new 79.Xr master.passwd 5 80and 81.Xr group 5 82files will 83.Sy always 84be automatically (re)created. 85.Pp 86.Nm 87will finish by running 88.Xr mtree 8 89to make sure the directory structure has correct permissions. 90.Pp 91The options are as follows: 92.Bl -tag -width Ds 93.It Fl b 94Batch mode. 95.Nm 96runs non-interactively, 97saving differing files for later manual processing. 98.It Fl d 99Diff mode. 100.Nm 101does not take any automatic action, allowing for a full diff comparison. 102.It Fl p 103Package mode. 104.Nm 105only compares the default configuration files of installed 106.Xr packages 7 107against their target on the system (@sample). 108.El 109.Pp 110Files can be excluded from comparison by listing them in 111.Pa /etc/sysmerge.ignore . 112The following files will always be skipped from direct comparison: 113.Pa /etc/group , 114.Pa /etc/localtime , 115.Pa /etc/mail/aliases.db , 116.Pa /etc/master.passwd , 117.Pa /etc/motd , 118.Pa /etc/passwd , 119.Pa /etc/pwd.db , 120.Pa /etc/spwd.db , 121.Pa /var/db/locate.database , 122.Pa /var/mail/root , 123.Pa /var/sysmerge/etcsum , 124.Pa /var/sysmerge/examplessum , 125.Pa /var/sysmerge/xetcsum . 126.Sh ENVIRONMENT 127.Bl -tag -width "EDITORXXVISUAL" 128.It Ev EDITOR , VISUAL 129Specifies an editor to use. 130If both 131.Ev EDITOR 132and 133.Ev VISUAL 134are set, 135.Ev VISUAL 136takes precedence. 137If neither 138.Ev EDITOR 139nor 140.Ev VISUAL 141are set, 142the default is 143.Xr vi 1 . 144.It Ev PAGER 145Specifies the pagination program to use. 146.It Ev TMPDIR 147Directory in which the work directory is created. 148If unset, this defaults to 149.Pa /tmp . 150.El 151.Sh FILES 152.Bl -tag -width "${TMPDIR}/sysmerge.XXXXXXXXXX" -compact 153.It Pa ${TMPDIR}/sysmerge.XXXXXXXXXX 154Default work directory. 155The 156.Sy temproot 157directory is created relative to this. 158.It Pa /etc/sysmerge.ignore 159Files and directories to ignore from comparison. 160.It Pa /var/sysmerge/backups 161Directory containing backup of 162.Nm 163last run modified files. 164Rotated automatically in order of increasing age from 165.Pa backups.0 166to 167.Pa backups.3 . 168.It Pa /var/sysmerge/etc.tgz 169Base system set containing the reference files 170corresponding to the currently installed release. 171.It Pa /var/sysmerge/xetc.tgz 172.Xr X 7 173set containing the reference files 174corresponding to the currently installed release. 175.El 176.Sh SEE ALSO 177.Xr more 1 , 178.Xr sdiff 1 179.Pp 180.Lk http://www.openbsd.org/faq/current.html 181.Lk http://www.openbsd.org/faq/upgradeXX.html 182.Sh HISTORY 183The 184.Nm 185script first appeared in 186.Ox 4.4 . 187.Sh AUTHORS 188.An -nosplit 189.Nm 190was written by 191.An Antoine Jacoutot Aq Mt ajacoutot@openbsd.org . 192It was originally started as a friendly fork from 193mergemaster by 194.An Douglas Barton Aq Mt DougB@FreeBSD.org . 195