hard link
A directory entry, which maps a filename to an inode, number. A file may have multiple names or
hard links. The link count gives the number of names by which a file is accessible. Hard links do not
allow multiple names for directories and do not allow multiple names in different filesystems.
init
'init' process is the first user level process started by the kernel. init has many important duties, such
as starting getty (so that users can log in), implementing run levels, and taking care of orphaned
processes. This chapter explains how init is configured and how you can make use of the different run
levels. init is one of those programs that are absolutely essential to the operation of a Linux system,
but that you still can mostly ignore. Usually, you only need to worry about init if you hook up serial
terminals, dial−in (not dial−out) modems, or if you want to change the default run level. When the
kernel has started (has been loaded into memory, has started running, and has initialized all device
drivers and data structures and such), it finishes its own part of the boot process by starting a user
level program, init. Thus, init is always the first process (its process number is always 1). The kernel
looks for init in a few locations that have been historically used for it, but the proper location for it is
/sbin/init. If the kernel can't find init, it tries to run /bin/sh, and if that also fails, the startup of the
system fails. When init starts, it completes the boot process by doing a number of administrative
tasks, such as checking filesystems, cleaning up /tmp, starting various services, and starting a getty for
each terminal and virtual console where users should be able to log in. After the system is properly
up, init restarts getty for each terminal after a user has logged out (so that the next user can log in).
init also adopts orphan processes: when a process starts a child process and dies before its child, the
child immediately becomes a child of init. This is important for various technical reasons, but it is
good to know it, since it makes it easier to understand process lists and process tree graphs. init itself
is not allowed to die. You can't kill init even with SIGKILL. There are a few variants of init available.
Most Linux distributions use sysvinit (written by Miquel van Smoorenburg), which is based on the
System V init design. The BSD versions of Unix have a different init. The primary difference is run
levels: System V has them, BSD doesn't.
inode
An inode is the address of a disk block. When you see the inode information through ls, ls prints the
address of the first block in the file. You can use this information to tell if two files are really the same
file with different names (links). A file has several components: a name, contents, and administrative
information such as permissions and modification times. The administrative information is stored in
the inode (over the years, the hyphen fell out of "i−node"), along with essential system data such as
how long it is, where on the disc the contents of the file are stored, and so on. There are three times in
the inode: the time that the contents of the file were last modified (written); the time that the file was
last used (read or executed); and the time that the inode itself was last changed, for example to set the
permissions. Altering the contents of the file does not affect its usage time and changing the
permissions affects only the inode change time. It is important to understand inodes, not only to
appreciate the options on ls, but because in a strong sense the inodes are the files. All the directory
hierarchy does is provide convenient names for files. The system's internal name for the file is its
i−number: the number of the inode holding the file's information.
Do'stlaringiz bilan baham: |