# 11.2-RELEASE stock /etc/ttys file ?



## PacketMan (Aug 9, 2018)

So last night I upgraded from 11.1 to 11.2 (RELEASE) and all went well except it got hung saying it could not merge my /etc/ttys files and told me to use vi to fix the conflicts manually. Trouble was it was not clear to me what the conflicts were.  I had some of the ttys lines commented out, so I removed those, but then I noticed after boot-up I had 7 (I think it was) process called "init" sort of sitting there.  I did some reading and came to the conclusion that I had duplicate but conflicting lines so I commented out the old ones. Scroll down to see below.

I'd like to replace that file with a bone stock 11.2-RELEASE file.  I'm guessing I probably could just edit out the lines, but I prefer to have the file be genuinely stock, if that makes sense.  Can I do this? (see below)

`cp /usr/src/etc/etc.amd64/ttys  /etc/ttys`

My /etc/ttys file currently:

```
# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
console none                            unknown off secure
#
ttyv0   "/usr/libexec/getty Pc"         xterm   onifexists secure
# Virtual terminals
<<<<<<< current version
#ttyv1  "/usr/libexec/getty Pc"         xterm   on  secure
#ttyv2  "/usr/libexec/getty Pc"         xterm   on  secure
#ttyv3  "/usr/libexec/getty Pc"         xterm   on  secure
#ttyv4  "/usr/libexec/getty Pc"         xterm   on  secure
#ttyv5  "/usr/libexec/getty Pc"         xterm   on  secure
#ttyv6  "/usr/libexec/getty Pc"         xterm   on  secure
#ttyv7  "/usr/libexec/getty Pc"         xterm   on  secure
=======
ttyv1   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv2   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv3   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv4   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv5   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv6   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv7   "/usr/libexec/getty Pc"         xterm   onifexists secure
>>>>>>> 11.2-RELEASE
ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
ttyu0   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
ttyu1   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
ttyu2   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
ttyu3   "/usr/libexec/getty 3wire"      vt100   onifconsole secure
# Dumb console
dcons   "/usr/libexec/getty std.9600"   vt100   off secure
```


----------



## PacketMan (Aug 9, 2018)

Never used `diff` before.

Before:
`diff /usr/src/etc/etc.amd64/ttys /etc/ttys`

```
33a34,42
> <<<<<<< current version
> #ttyv1    "/usr/libexec/getty Pc"        xterm    on  secure
> #ttyv2    "/usr/libexec/getty Pc"        xterm    on  secure
> #ttyv3    "/usr/libexec/getty Pc"        xterm    on  secure
> #ttyv4    "/usr/libexec/getty Pc"        xterm    on  secure
> #ttyv5    "/usr/libexec/getty Pc"        xterm    on  secure
> #ttyv6    "/usr/libexec/getty Pc"        xterm    on  secure
> #ttyv7    "/usr/libexec/getty Pc"        xterm    on  secure
> =======
40a50
> >>>>>>> 11.2-RELEASE
```

Deleted those lines.

Now diff comes up empty, with tells me the files are identical. Hopefully I used the right one to compare with.


----------



## ShelLuser (Aug 9, 2018)

What do you think could go wrong here?

This seems obvious enough IMO. If you don't trust diff there's always comparing file sizes as well as ttys(5) (so: `man ttys`).


----------



## PacketMan (Aug 9, 2018)

Well since its ttys if I screw it up and it doesn't 'load in' then I am trouble for logging into the machine right? Have to go dig out the old console connection.  I wasn't just sure if I was using a right file for comparism purposes, but given the similiarity between the two, and the name (/etc.amd64/ttys) I felt safe.

As I've said before I haven't gotten to know FreeBSD internals as well as I had hoped.  I so darn busy and the OS simply runs 'forever' without needing any love, even during most if not all of my updating.


----------



## xtaz (Aug 10, 2018)

For future reference, what that is showing you is your original file and the newer file merged together in the same file. the lines with <<<, ===,  and >>> in them are markers which shouldn't normally be in the file and this is why it broke. Between the <<< and === are the lines from your existing file and between the === and >>> are the lines from the new file that it wants you to merge.

What you should do in this situation is to use your editor to merge the lines as you feel is appropriate, or totally delete one in favour of the other. And also delete the three marker lines.

So effectively you've done this by using diff and deleting those lines that came up.

Take a read of the man page for the merge(1) command


----------



## bds (Aug 13, 2018)

One thing that snagged me when upgrading - the onifexists flag is introduced in 11.2. So if merge in this flag but don't reboot after the installation in single-user mode you've still got the previous version's /sbin/init running, which treats it as invalid - so no login prompt. That'll teach me to be lazy...


----------

