cvsup question Re: Re: Upgrade or Install new version of freebsd for Sendmail

Matthew Seaman m.seaman at infracaninophile.co.uk
Tue May 13 03:02:57 PDT 2003


On Mon, May 12, 2003 at 10:08:37PM -0700, RN Hosting wrote:
> > From: Matthew Seaman <m.seaman at infracaninophile.co.uk>
> >
> >    # shutdown -r now
> >
> > (Interrupt the reboot during the 10 second countdown, and boot to
> > single user..)
> >
> >    boot: boot -s
> >    # fsck -p
> >    # mount -a
> >    # swapon -a
> >    # cd /usr/src
> >    # make installworld
> >    # mergemaster
> >    # reboot
> >
> > With practice, you can easily do this whole single user part of the
> > update in under 15 minutes.
> 
> Thank you for these instructions on how to enter single user mode. I have
> read several how-tos on using cvsup and they all mention "dropping into
> single user mode" yet none of them have described how to do that.

I guess that's one of those things that's so obvious no one ever
explains how to do it.  There's actually two routes to get to single
user mode:

   i) Just run 'shutdown'

   This will force all of the users to log out and close down all
   processes, but leaves the system with all of it's network
   interfaces configured and all of filesystems mounted.

   ii) As shown above, interrupt the reboot sequence at the countdown
   and run 'boot -s'.

   This will leave you with the kernel running, the root partition
   mounted read-only and not a lot else.  The rest of the commands
   listed serve to get the system into a state where you can run 'make
   installworld' and 'mergemaster' successfully.

For an update of the system, you need to use method two so that you've
booted up your new kernel.  This also gives you a chance to back out
the new kernel if it fails to boot properly, before you've gone and
installed the rest of the system, which would be a real pain to undo.

> One question that I have is is it possible to enter single user mode as you
> have described over SSH or do you have to be physically at the server?

No -- you can't get into single user mode via a remote login.  You
need to be sat at the system console.  If you need to update a system
at a remote site, then it gets a little tricky, but not impossible.

You could manually shutdown as many of the processes running on the
system as possible, kick all the users off and do whatever else you
can to make the machine quiescent and then just run the 'make
installworld' and 'mergemaster' steps from multiuser mode and reboot.
Chances are you'll get away with that, especially if it's a relatively
small jump in version numbers.  However, if things go wrong, then you
are up a gum tree.  Your vital server has been left unbootable and you
haven't got any recourse other than to get physical access to the
machine and do a full disaster recovery re-install backups from
scratch type exercise.

The more sensible alternative is to arrange for remote console access.
Some enlightened hosting companies will offer this as part of their
package.  Otherwise, you're going to have to make your own
arrangements.  Generally what you do is arrange for the system console
to sit on one of the serial ports by setting the correct options in
your kernel config (see the descriptions of the flags in sio(4) and
the equivalent section in LINT).  Then you can either invest in a
console server -- for instance

    http://www.lantronix.com/products/cs/scs820_scs1620/index.html

or if you're not made of money you can string a cable from the 2nd
serial port on a neighbouring machine to the 1st (console) serial port
on the machine in question.  Then on the neighbouring machine, run:

    # tip com2

and you should get the console login for the first machine.  I can't
remember off hand the spec for the serial cable that you will need,
but it's a pretty standard item.  Searching the FreeBSD mailing list
archives will help you locate the right part.

Once you've got the remote access, then you can do the upgrade
remotely exactly as if you were sitting in front of the machine.
 
> In the past I have upgraded using CVSUP like this:
> 
> cvs_file contents:
> 
> 
>  *default  host=cvsup2.FreeBSD.org
>  *default  base=/usr
>  *default  prefix=/usr
>  *default  release=cvs
>  *default  tag=RELENG_4
>  *default  delete use-rel-suffix
>  src-all
>  *default tag=.
> 
> 
> cvsup -g -L 2 cvs_file
> cd /usr/src
> make buildworld
> make buildkernel
> make installkernel
> make installworld
> reboot

Yup.  Like I said, that usually works, but it can leave you in a world
of hurt if it doesn't go smoothly.  Oh --- you do need to run
mergemaster somewhere in there too.
 
> Now I upgraded from 4.7 release to 4.8 stable and everything seems to have
> been running fine for the past two weeks since I did so except on two
> seperate occasions the server has completely frozen and been unresponsive
> until my NOC did a forced reboot for me and everything came back to normal
> with no signs of the problem in any log files.
> 
> Also RAM usage has been unusally high, so I am beginning to suspect that
> maybe I messed something up by not using cvsup correctly.  If anyone would
> like to help enlighten me as to how important it is to be in single user
> mode when installing the new kernel and world (there was no other users
> logged in to the machine at the time) and what all else that I might have
> done wrong I would greatly appreciate it.

No.  If the system boots and runs for several weeks, then it's
exceedingly unlikely to be due to corrupted source code, or an
improper procedure used when upgrading.  Those tend to have a more
immediate effect.  I'd say you're running cvsup(1) etc. correctly, but
that you were unlucky in the sources you pulled down when you chose to
run cvsup(1).  RELENG_4 aka 4.8-STABLE is still a development branch,
and despite the best efforts of the committers sometimes mistakes
creep in or new code doesn't react in quite the intended way.

A good procedure is to cvsup a day or so in advance, and monitor the
freebsd-stable at ... list for any reports of problems before updating.

It's also possible that the problems you're seeing are not related to
your having upgraded at all.  It may be just a coincidence that there
has been some sort of hardware problem so close to when you updated,
or you might be suddenly getting a surge in traffic which is
pushing your machine over the edge.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030513/a2cd23e3/attachment.bin


More information about the freebsd-questions mailing list