From owner-freebsd-stable@FreeBSD.ORG Tue Apr 19 20:45:25 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 70AEF16A4CE for ; Tue, 19 Apr 2005 20:45:25 +0000 (GMT) Received: from pne-smtpout2-sn1.fre.skanova.net (pne-smtpout2-sn1.fre.skanova.net [81.228.11.159]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B9D343D41 for ; Tue, 19 Apr 2005 20:45:24 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from falcon.midgard.homeip.net (212.181.162.201) by pne-smtpout2-sn1.fre.skanova.net (7.1.026.7) id 41E3209600D357B8 for freebsd-stable@freebsd.org; Tue, 19 Apr 2005 22:45:23 +0200 Received: (qmail 30751 invoked by uid 1001); 19 Apr 2005 20:45:22 -0000 Date: Tue, 19 Apr 2005 22:45:22 +0200 From: Erik Trulsson To: Bill Moran Message-ID: <20050419204522.GA28137@falcon.midgard.homeip.net> Mail-Followup-To: Bill Moran , Chuck Swiger , freebsd-stable@freebsd.org References: <426447F8.5090209@charter.net> <200504191317.j3JDH76H001458@drjekyll.mkbuelow.net> <20050419120053.6ad17df1.wmoran@potentialtech.com> <42655B8E.5020603@mac.com> <20050419163237.76a99373.wmoran@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050419163237.76a99373.wmoran@potentialtech.com> User-Agent: Mutt/1.5.9i cc: freebsd-stable@freebsd.org Subject: Re: Newbie Question About System Update X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2005 20:45:25 -0000 On Tue, Apr 19, 2005 at 04:32:37PM -0400, Bill Moran wrote: > Chuck Swiger wrote: > > Bill Moran wrote: > > > The system can not replace programs that are in use, > > > > This is generally not the case. Unix lets you continue to access a file after > > it has been deleted, so long as the process hangs on to a file descriptor. > > This lets you replace programs in use, without running into the same problems > > that platforms like Windows have. > > What you say?: > > bash-2.05b$ su > Password: > bolivia# cp /usr/sbin/cron /home/wmoran/. > bolivia# cp /home/wmoran/cron /usr/sbin/. > cp: /usr/sbin/./cron: Text file busy > bolivia# > > Notice that /usr/sbin/cron is in use (because my system is running > normally) I can copy _from_ that file, but I can not overwrite it. > > Apparenlty, nobody who is claiming this has _tried_ it. Try it yourself > and see. You can _not_ replace programs that have their Text section > in use (i.e. the code) because the demand pager has that area of the > file locked. You apparently cannot modify a program that is in use. What you *can* do is delete it and create a new file with the same name. Try using 'cp -f' instead of plain 'cp'. (Or use the install(1) utility, which is what installworld normally uses, which also unlinks the old file before creating the new.) -- Erik Trulsson ertr1013@student.uu.se