Re: Reducing downtime on system critical services
Ben Collins writes ("Re: Reducing downtime on system critical services"):
> Sounds like old a.out issues to me. I have had no problems with openldapd
> upgrades of this sort. Basically (from my reading of the dpkg code), dpkg
> will attempt to write to the file, if it cannot, then it will attempt to
> unlink it, then write the new file. The beauty behind this is that when
> the file us unlinked (use slapd for this example), then it's inode is
> still in use by the system (the running process), so it is not really
> deleted from the harddisk, it's just not referenced from the filesystem
> itself. Once the process is killed, then the inode is freed.
In fact, dpkg will always write to a temporary name and then use
rename(2) to `overwrite' the old file (actually, this simultaneously
unlinks the old file and makes its name point to the new file, and
then removes the other link to the new file).
This is necessary to make sure that things don't go badly wrong if
(eg) the system runs out of disk space.