Comment by AndrewDucker
Comment by AndrewDucker 16 hours ago
Windows locks files when they're in use, so that you cannot overwrite them. Linux doesn't do this.
So if you want to overwrite a running service then you can either stop it, update it, and restart it (tricky to manage if it has dependencies, or is necessary for using the PC), or to shut down everything, update the files while the OS isn't (or is barely) running, and then restart the OS.
> Windows locks files when they're in use, so that you cannot overwrite them. Linux doesn't do this.
Linux does do this (try overwriting or truncating a binary executable while it's running and you'll get -ETXTBSY).
The difference is that Linux allows you to delete (unlink) a running executable. This will not free the on-disk space occupied by that executable (so anything you write to disk in the immediate future will not overwrite the executable, and it can continue executing even if not all of the executable has been paged in) until all references to its inode are freed (e.g. the program exits and there are no other hardlinks to it).
Then you can install a new version of the executable with the same name (since a file by that name no longer exists). This is what install(1) does.