How did upgrading applications happen before portupgrade etc?

Rakhesh Sasidharan rakhesh at rakhesh.com
Sat Aug 11 22:28:02 PDT 2007


Jeremy Chadwick wrote:

> On Sat, Aug 11, 2007 at 03:02:53PM +0400, Rakhesh Sasidharan wrote:
>>> 5.  pkg_delete port
>>
>> I see. In step 5, "pkg_delete port" wont work if port is required by others
>> right? So you delete those apps too? Could be a lot of stuff to uninstall,
>> right?
>
> Absolutely correct.  That might seem like a nightmare to most people,
> but to me it's not.  I suppose this is also why I avoid ports that have
> too many dependencies (mail/p5-Mail-SpamAssassin, for example, is
> starting to make me consider using dspam instead).

It did to me. But yeah, if you limit yourself to ports without too many 
dependencies, then its fine. And also, if you are doing this only once in 
a while, it limits downtime too. Makes sense.

>>> Note that we keep all of our configuration files in a directory called
>>> /conf/ME and in /usr/local simply use symlinks.  (Matt Dillon might be
>>> grinning over /conf/ME, since it's a Best Internet-ism :) ).  I don't
>>> trust that all ports will "play nice" with existing configuration files
>>> in /usr/local, and I have seen much evidence of this in the past (nuking
>>> files without your knowledge, mainly.  "Oh crap! It nuked our entire
>>> configuration for the apache/mail/whatever server!!!").
>>
>> That's a smashing idea! Thanks for mentioning that here. :-)
>>
>> What does the "ME" stand for in /conf/ME btw?
>
> "ME" stands for me, e.g. "myself".  I guess it'd help if I explained how
> it worked:
>
> The /conf directory on all machines contained the configuration files
> for itself as well as every other machine on the network.  So for
> shell01.whatever.com you'd find this in /conf:
>
>  /conf/ME --> /conf/shell01.whatever.com
>  /conf/mail01.whatever.com/
>  /conf/shell01.whatever.com/
>  /conf/shell02.whatever.com/
>  /conf/sql01.whatever.com/
>  /conf/test.whatever.com/
>
> Each directory contained configuration files specific to that system.

Wicked! I just take backups of the /etc and /usr/local/etc of each machine 
onto every other machine but the method above is even better. Esp in light 
of what you mention later on ...

> During system install, either done automatically or manually (I forget),
> the /conf directory on a machine is populated, and the ME symlink is
> made.  Then the script would populate /usr/local with symlinks, and I
> believe also did a mkdir -p on directories.  For example, if /conf/ME
> contained:
>
>  etc/Muttrc
>  etc/apache22/httpd.conf
>  etc/mail/spamassassin/local.cf
>  etc/pine.conf
>  etc/sudoers
>
> You'd find this in /usr/local:
>
>  etc/Muttrc  -->  /conf/ME/etc/Muttrc
>  etc/apache22/httpd.conf  -->  /conf/ME/etc/apache22/httpd.conf
>  etc/mail/spamassassin/local.cf  -->  /conf/ME/etc/mail/spamassassin/local.cf
>  etc/pine.conf  -->  /conf/ME/etc/pine.conf
>  etc/sudoers  -->  /conf/ME/etc/sudoers

Dodo question maybe: but instead of symlinking specific files, why not 
just symlink /usr/local/etc to something like /conf/ME/etc? The way you 
described it, would you also have to keep track of new config files, move 
them over to /conf/ME/etc, and then symlink from /usr/local/etc? If you 
symlink the whole directory, you save that hassle right?

Plus, later on, when you want the machine to switch roles, its just a 
matter of changing the directory symlink rather than of each file ...

> I believe the reason each machine had a copy of all the other machines'
> configs was in case one got munged on the repository server (or if you
> needed to "roll back" and didn't make a backup of your changes, oops),
> and/or if you wanted to change the "role" of a machine on the fly.
>
> All of the packages/ports installed on all the machines were 100%
> identical; that is, every machine, regardless of role, had the same
> packages/ports installed.

A very interesting tip btw. So you essentially have all the machines 
ready to switch roles at the change of a symlink. Neat! This idea was 
by Matt Dillon eh? :-)

You have any scripts etc to keep this running? Would be nice if you could 
drop a copy so I can poke around ...

Thanks,
Rakhesh


More information about the freebsd-ports mailing list