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