Saturday, April 5, 2014

Linux don't care...

Say for example, Windows won't let you delete or back up an open file. Even if you wanted to easily create a snapshot of a volume and back up an open file in a consistent manner, it's not that easy.

Linux don't care...

In fact, a recent question I was asked in an interview pre-screening, was whether you can delete an in-use logfile and if that space is automatically marked free by the OS?

The answer to that is, no. On Linux, a file can be deleted when it's in-use. The file will disappear from the FS, but the handle to the file will remain open, and in fact, the application will continue to write to the file even when its hard link count is now exactly zero! That log file will actually appear in the /proc filesystem under that process' PID, in its list of open files. In order to actually delete the file you need to close the file handle. This is done in various ways depending on the application, but it can usually be triggered quite easily, and as a sysadmin, you should why and how you should do this.

UNIX expects you to be a competent and knowledgeable sysadmin, and this has the advantage of creating a very predictable environment with few exceptions to basic tenets laid out as a contract of sorts

I like that.

I like being treated like an adult.

No comments:

Post a Comment