*BSD News Article 10177


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA7342 ; Mon, 18 Jan 93 10:52:19 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!sdd.hp.com!elroy.jpl.nasa.gov!swrinde!gatech!news.byu.edu!ux1!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: 386BSD INIT Problem?
Message-ID: <1993Jan20.203939.10054@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Organization: Weber State University  (Ogden, UT)
References: <C12nrG.19p@crucible.demon.co.uk> <1993Jan19.160152.10194@kth.se>
Date: Wed, 20 Jan 93 20:39:39 GMT
Lines: 33

In article <1993Jan19.160152.10194@kth.se> d88-jwn@czarny.nada.kth.se (Johan Wåhlin) writes:
>Init is a program being run I think.
>Therefore you cannot copy a new version of it over the old one. You
>need to boot up with a floppy and then copy the new version over the old one.

You *should* be able to copy over a running image; what's supposed to
happen is that the running image is unlinked, but the inode is not put
on the free list until the open file reference count is 0.  This lets
running images swap text in from the previous disk image.  A new inode
is allocated and the data copied to blocks off of it.  The original inode
is freed when the last image exits.

What happens (and this is the bug) is that the blocks get overwritten by
the new file; some of them are in-core.  There's a problem with the VM
system making a distinction between  file block and executable image blocks
for shared text pages.

The upshot is that you can avoid the problem by mv'ing the running image
before doing the copy so that the executing image isn't overwritten.  This
workaround applied to all executing images, not just init.


					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.
-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------