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