# freebsd-update: mergemaster issue



## alexus (Oct 1, 2013)

I was trying to upgrade my FreeBSD 9.1-RELEASE-p7 to FreeBSD 9.2-RELEASE and I ran into some issues:


```
# mergemaster

*** The directory specified for the temporary root environment,
    /var/tmp/temproot, exists.  This can be a security risk if untrusted
    users have access to the system.

  Use 'd' to delete the old /var/tmp/temproot and continue
  Use 't' to select a new temporary root directory
  Use 'e' to exit mergemaster

  Default is to use /var/tmp/temproot as is

How should I deal with this? [Use the existing /var/tmp/temproot] 

   *** Leaving /var/tmp/temproot intact

*** Creating the temporary root environment in /var/tmp/temproot
 *** /var/tmp/temproot ready for use
 *** Creating and populating directory structure in /var/tmp/temproot

mtree: line 21: unknown user auditdistd

  *** FATAL ERROR: Cannot 'cd' to /usr/src and install files to
      the temproot environment

# grep auditdistd /etc/*passwd
/etc/master.passwd:auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin
/etc/passwd:auditdistd:*:78:77:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin
# pwd_mkdb -p /etc/master.passwd 
# id auditdistd
uid=78(auditdistd) gid=77(audit) groups=77(audit)
# mergemaster 

*** Creating the temporary root environment in /var/tmp/temproot
 *** /var/tmp/temproot ready for use
 *** Creating and populating directory structure in /var/tmp/temproot

install: illegal option -- l
usage: install [-bCcMpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcMpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...

  *** FATAL ERROR: Cannot 'cd' to /usr/src and install files to
      the temproot environment

#
```

*P*lease advise*.*


----------



## ShelLuser (Oct 1, 2013)

What exactly did you use to upgrade? You mention the use of mergemaster here but your subject mentions freebsd-update.

The first thing which comes to my mind is that you don't have the FreeBSD source code available in /usr/src which appears to be essential for mergemaster (according to the mergemaster(8) manualpage).

I'd like to point your attention to the official upgrade documentation for FreeBSD 9.2-RELEASE. You'll notice that mergemaster isn't mentioned when using freebsd-update for upgrading.


----------



## alexus (Oct 1, 2013)

ShelLuser said:
			
		

> What exactly did you use to upgrade? You mention the use of mergemaster here but your subject mentions freebsd-update.



I used freebsd-update to update my FreeBSD, I used the same way to update all patch levels.



			
				ShelLuser said:
			
		

> The first thing which comes to my mind is that you don't have the FreeBSD source code available in /usr/src which appears to be essential for mergemaster (according to the mergemaster(8) manualpage).



*M*y guess here (and I may be wrong) is my /usr/src/ is from RELENG-9.1, while mergemaster is having issues because I'm on RELENG-9.2.


```
# grep ^Components /etc/freebsd-update.conf
Components src world kernel
#
```



			
				ShelLuser said:
			
		

> I'd like to point your attention to the official upgrade documentation for FreeBSD 9.2-RELEASE. You'll notice that mergemaster isn't mentioned when using freebsd-update for upgrading.



I followed the same instruction while trying to update.


----------



## kpa (Oct 1, 2013)

As far as I know you're not supposed to use mergemaster(8) with freebsd-update(8) at all but to leave the merging of configuration and other files to the internal merge tool of freebsd-update(8).


----------



## alexus (Oct 1, 2013)

kpa said:
			
		

> As far as I know you're not supposed to use mergemaster(8) with freebsd-update(8) at all but to leave the merging of configuration and other files to the internal merge tool of freebsd-update(8).



I have nothing against that, but it seems like something went wrong and perhaps not everything was done properly, as I just noticed even though auditdistd user was inside of my passwd when I did `id auditdistd` it didn't show me that user, so I'm trying to re-do whatever was not done..


----------



## ShelLuser (Oct 1, 2013)

Indeed. @kpa beat me to it


----------



## ShelLuser (Oct 1, 2013)

alexus said:
			
		

> I have nothing against that, but it seems like something went wrong and perhaps not everything was done properly, as I just noticed even though auditdistd user was inside of my passwd when I did id auditdistd it didn't show me that user, so I'm trying to re-do whatever was not done..


Actually it doesn't. As @kpa said (which I can confirm) you're not supposed to use mergemaster when upgrading your FreeBSD system.

The right instructions can be found in the URL I posted earlier. It's basically an issue of using freebsd-update to both _upgrade_ (actually this downloads the patches) and _install_ the upgrades. The last command should probably be used two times.

But you don't need mergemaster here.


----------



## alexus (Oct 1, 2013)

ShelLuser said:
			
		

> Actually it doesn't. As @kpa said (which I can confirm) you're not supposed to use mergemaster when upgrading your FreeBSD system.
> 
> The right instructions can be found in the URL I posted earlier. It's basically an issue of using freebsd-update to both _upgrade_ (actually this downloads the patches) and _install_ the upgrades. The last command should probably be used two times.
> 
> But you don't need mergemaster here.



if everything would go through fine, yes, I agree you would not need to run mergemaster, but it did NOT, so I do need to do that (please see my original post which covers my finding).


----------



## kpa (Oct 1, 2013)

Your assumption that you can use mergemaster(8) to fix the problem is completely wrong, that's what we have been trying to tell you all along. If you're adamant that you want to use mergemaster(8) switch to source based updating and forget freebsd-update(8) even exists.


----------



## alexus (Oct 1, 2013)

kpa said:
			
		

> Your assumption that you can use mergemaster(8) to fix the problem is completely wrong, that's what we have been trying to tell you all along. If you're adamant that you want to use mergemaster(8) switch to source based updating and forget freebsd-update(8) even exists.



*O*k, let me ask you this then: is there a way to verify that freebsd-update did all it is supposed to? *T*hat I didn't mess anything up while running `freebsd-update`? *A*nd if `freebsd-update` runs itself properly then why was the user missing? *I* mean it's pretty obvious (at least to me) that something isn't right, so *I*'m asking how to handle this situation and your answer is "if you run freebsd-update it should've handled everything else" but it didn't! *S*o what do I do now?


----------



## ShelLuser (Oct 1, 2013)

alexus said:
			
		

> is there a way to verify that freebsd-update did all it suppose to? that I didn't mess anything up while running freebsd-update? and if freebsd-update run itself properly then why was user missing?


The user wasn't missing, you've shown that yourself. As we mentioned a few times now: you're using a tool (mergemaster) in a situation where you shouldn't have.



			
				alexus said:
			
		

> i mean it's pretty obvious (at least to me) that something isn't right, so i'm asking how to handle this situation and your answer is "if you run freebsd-update it should've handled everything else" but it didn't! so what do I do now?


How did you come to conclude that freebsd-update didn't do its job?

As I mentioned earlier]mergemaster[/file] didn't run here is most likely because your /usr/src is empty. And I doubt that this has anything to do with freebsd-update.

Because all you've shown us is the mergemaster session there's very little we can comment on here. You seem determined that something is wrong, but so far I've seen nothing which supports that conclusion.


----------



## alexus (Oct 1, 2013)

ShelLuser said:
			
		

> The user wasn't missing, you've shown that yourself. As we mentioned a few times now: you're using a tool (mergemaster) in a situation where you shouldn't have.



How did you come to conclude that freebsd-update didn't do its job?[/QUOTE]

I'm not sure how or why, but while user was inside of /etc/passwd and /etc/master.passwd, it was missing in /etc/passwd.db and /etc/spwd.db ... I assume freebsd-update should've taken care of running pwd_mkdb, but it didn't or maybe it was me who did something wrong, but after reboot user auditdistd wasn't appearing when I was running "id auditdistd", so after I manually ran pwd_mkdb then I got user to appear to system. 



			
				ShelLuser said:
			
		

> As I mentioned earlier; the reason why mergemaster didn't run here is most likely because your /usr/src is empty. And I doubt that this has anything to do with freebsd-update.



my /usr/src is _NOT_ empty:


```
# du -hcs /usr/src/
800M	/usr/src/
800M	total
#
```

I run few jails (which came from /usr/src).



			
				ShelLuser said:
			
		

> Because all you've shown us is the mergemaster session there's very little we can comment on here. You seem determined that something is wrong, but so far I've seen nothing which supports that conclusion.



I apologize for not providing enough for you to work with. I guess I'm little confused what information is needed to provide, if you could let me know what is that you're looking for I'll be more than happy to provide.

my goal isn't just to run "mergemaster" but to insure that my system runs correctly and that there is no surprised down the road, in the past by running mergemaster, it would usually tell me that all IDs are the same on my system as whatever mergemaster was checking against for and for me that was perfect indication that everything is correct.


----------



## ShelLuser (Oct 2, 2013)

alexus said:
			
		

> ShelLuser said:
> 
> 
> 
> ...


I just looked into freebsd-update (it's a shell script so it's relatively easy to study) and it does provide this functionality. However I'm somewhat convinced that this is only limited to accounts which are part of the base system.

So any user accounts which you added yourself will not be accounted for. Simply because the system won't detect any differences between the "base accounts" of FreeBSD 9.2 and those of the previous FreeBSD 9.1.

Something you will notice when running freebsd-update because it will automatically check the config files of the base system and if there is a difference it will either apply any updates itself or ask you to manually look into the differences and apply any changes when required.

In my opinion the best way to determine any issues is to carefully monitor what freebsd-update has been doing.


----------

