From owner-freebsd-questions@FreeBSD.ORG Tue May 13 03:02:57 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0429937B401 for ; Tue, 13 May 2003 03:02:57 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C20E43FB1 for ; Tue, 13 May 2003 03:02:55 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h4DA2oJG053315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 May 2003 11:02:51 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)h4DA2oWi053314; Tue, 13 May 2003 11:02:50 +0100 (BST) (envelope-from matthew) Date: Tue, 13 May 2003 11:02:50 +0100 From: Matthew Seaman To: RN Hosting Message-ID: <20030513100250.GA52461@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , RN Hosting , freebsd-questions@freebsd.org References: <20030512190043.CA76737B408@hub.freebsd.org> <3676.66.190.246.64.1052802517.squirrel@www.reallynicehosting.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <3676.66.190.246.64.1052802517.squirrel@www.reallynicehosting.com> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-38.8 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT version=2.53 X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp) cc: freebsd-questions@freebsd.org Subject: Re: cvsup question Re: Re: Upgrade or Install new version of freebsd for Sendmail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2003 10:02:57 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 12, 2003 at 10:08:37PM -0700, RN Hosting wrote: > > From: Matthew Seaman > > > > # 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. >=20 > 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 y= ou > 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. =20 > In the past I have upgraded using CVSUP like this: >=20 > cvs_file contents: >=20 >=20 > *default host=3Dcvsup2.FreeBSD.org > *default base=3D/usr > *default prefix=3D/usr > *default release=3Dcvs > *default tag=3DRELENG_4 > *default delete use-rel-suffix > src-all > *default tag=3D. >=20 >=20 > 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. =20 > 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. >=20 > 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@... 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 --=20 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 --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE+wMLKdtESqEQa7a0RAglCAJ96JmJvfzb8jMmvV5CTgpMi2liH+QCdGFcm uIFwHT+kTtK075AdmQas5DU= =Zwmb -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--