
Thanks to Locutus for making this post. Its a great eye opener.
Here's what I think the whole text should be as I've modified a few lines..
It all comes down to how linux and the file system handles files. When linux runs an executable it loads the whole file into buffers in clusters (which is a technical term, it's typically 4k, but you can set it when setting up your filesystems) and accesses it from there. This means that there is no connection to the physical file on the disk drive. When the program is closed and all connections to the file are cut, the file is deleted from memory.
When you open a file, the kernel follows the link, and assigns the inode a file descriptor (a number that it keeps track of internally). When you delete the file, you are "unlinking" the inode; the file descriptor still points to it. You can create a new file with the exact same name as the old file after deleting it, effectively "replacing" it, but it will point to a different inode. Any programs that still have the old file open can still access the old file via the file descriptor, but you have effectively upgraded the program in place. As soon as the program terminates (or closes the file), and starts up (or tries to access it again), it accesses the new file, and there you have it, a completely in-place replacement of a file!
So while the program is running, from memory, the physical file on the disk can be updated or changed at will and the running program is not affected. If the program is then closed, and the copy is deleted from memory, it can then be started again using the new file version.
No Need to Reboot in Linux for Software Upgrades or Installs source






Thanks a lot for the glowing review. I am glad that you found it useful.
Posted by: Locutus | March 1, 2007 9:02 AM | Permalink to Comment