Newbie Question About System Update
Dan Nelson
dnelson at allantgroup.com
Tue Apr 19 13:39:14 PDT 2005
In the last episode (Apr 19), Bill Moran said:
> Chuck Swiger <cswiger at mac.com> 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.
What you can do, however, is: create the new file under a temporary
name, delete the original, and rename the temp file to the orignal's
name, which is what /usr/bin/install does. I've done many
installworlds on running systems without problems.
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-stable
mailing list