# Upgrade merge file issue



## John Watson (Oct 28, 2018)

During a minor upgrade from 11.1 to 11.2 a file merge failed for /etc/ssh/sshd_config. During the edit of this file, I didn't pay attention to the upgrade adding the following lines. "<<<<<<< current version" and ">>>>>>> 11.2-RELEASE" both these lines caused a syntax error after a reboot and ssh wasn't loaded. Can someone explain the reason for adding lines during an upgrade that will cause a critical service to fail?


----------



## rigoletto@ (Oct 28, 2018)

It should had happened while you were using mergemaster(8). These lines are to indicate where the changes happened and so you know what you need to do to _merge_ the changes.

When you don't want to do any change in the file (keep you modified file) you have the option to use `d` (delete) during the `mergemaster` process, which will remove the temporary stored default file, and keep your modified file intact.


----------



## xtaz (Oct 28, 2018)

This isn't mergemaster(8). This is freebsd-update(8) which uses sdiff(1). It is part of the upgrade procedure that it merges configuration changes in /etc and you have to know what you are doing so that you complete the upgrade correctly.

You need to edit the file and manually merge the conflicts between the old version and the new version. It will have split the file using those <<< and >>> blocks where one side is the old and the other side is the new. Simply delete or edit those blocks until you are satisfied with the finished result, delete the conflict block lines, and save the file.


----------



## rigoletto@ (Oct 28, 2018)

I rarely use freebsd-update(5), but the few times I used I had no problems. So, you may also want to take a look on what is in `MergeChanges` and `UpdateIfUnmodified` in freebsd-update.conf(5).


----------



## kpa (Oct 28, 2018)

It will show the differences of the existing files and the to be installed new files and asks what to do. If you don't pay attention to what you're being asked the merge tool will save the differences in the files for you to solve. This is by design because there is no automatic way to solve the conflicts, leaving the old files as they are is equally dangerous as automatically installing the new files over the changed old ones.


----------

