This is usually done as part of the process creation by the daemon.
All file descriptors are closed, so a long daemon does not require extra resources. For example, if the daemon had to inherit the open file, and the daemon did not close it, then the file could not be deleted (the storage for it would remain allocated until it was closed), and the file system in which the file is located cannot be unmounted.
The process demonstration will also take a number of other actions, but these actions are beyond the scope of this issue.
source
share