Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet160/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   156   157   158   159   160   161   162   163   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

configuration files
for tuning the operating system to your needs as well 
as other forms of data files such as the /etc/passwd file storing user account information. 
Most of the files in /etc are text files, editable with vi. The /etc directory also has several 


The Linux File System

425
subdirectories that contain further groups of configuration files. You have already seen 
a few of these files such as passwd, group, and shadow, and you will explore many more 
of these files in later chapters as we examine services, system initialization, networking, 
scheduling, and other topics.
Below we spotlight some of the other important files and subdirectories. Note that the 
contents of /etc will vary by distribution and even by version of each distribution. The fol-
lowing list comes from what you can find in CentOS 6.
• abrt/—a directory containing configuration files for dealing with software crashes.
• aliases—a file of user aliases (i.e., user names that are aliased to other users); typically 
you will find several software usernames are aliases for root such as bin, daemon, and 
adm. You are able to add further aliases such as www to webmaster and webmaster 
to a particular user.
• anacrontab—configuration file for the anacron program.
• at.allow, at.deny—files that list users allowed to or not allowed to use at.
• audit/—directory that contains configuration files for the auditd service.
• auto.master, auto.misc, auto.net, auto.smb—configuration and map files for auto-
matic mounting.
• avahi/—contains configuration files for the avahi daemon used to register local IP 
addresses and DNS-related services.
• bashrc—the file that executes whenever a new bash shell opens; edited by the system 
administrator.
• cron.d/, cron.daily/, cron.hourly/, cron.monthly/, cron.allow, cron.deny, crontab—
directories and configuration files that support the crontab daemon for scheduling 
processes.
• cups/—the directory containing cups printing configuration files.
• dnsmasq—configuration file for dnsmasq.d daemon that performs DNS forwarding 
for a NAT network server.
• fonts/—directory of font configuration files for system fonts.
• gdm/—directory of configuration files for the gnome desktop manager.
• hosts, hosts.allow, hosts.deny—the host tables, files that store IP alias to IP address 
mapping, and lists of hosts allowed to or not allowed to connect to this computer.
• httpd/—directory containing the Apache web server configuration, data, and execut-
able files (if not installed elsewhere).
• init, inittab, init.d/—the startup service, a configuration file storing the default run 
level, and a directory containing all system service control scripts.


426

Linux with Operating System Concepts
• logrotate.conf, logrotate.d—configuration file and daemon for log rotation.
• mime.types—mapping of mime type to file extension.
• nfsmount.conf—nfs mount daemon configuration file.
• nsswitch.conf—configuration file for the network service switch daemon.
• oddjob—configuration file for oddjobd daemon.
• pam.d/—directory containing pluggable authentication module program, data, and 
configuration files.
• rc, rc.local, rc.sysinit—startup scripts in charge of starting system services.
• rc0.d/, rc1.d/, …, rc6.d/—directories containing symbolic links to services that are to 
be started for the given run level (e.g., rc5.d stores the services to be started for run 
level 5).
• selinux/—directory containing security enhanced Linux configuration files.
• sysconfig/—directory containing scripts and configuration files for network opera-
tions including the Linux firewall (iptables, ip6tables).
• yum, yum.conf, yum.repos.d—yum configuration files.
10.5.4 /home
The /home directory contains all of the users’ home directory space. This is where users 
by default will store their personal data files, scripts, multimedia files, and so forth. Group 
directories can also be established under /home.
Being on a separate partition allows us to treat this file system differently from others. 
We might for instance implement a disk quota on /home to help control the usage of this 
partition. If this file system were implemented with the option noexec, users would not be 
able to run software directly from their own file space, perhaps discouraging them from 
downloading and installing software. By keeping /home separate, it also helps facilitate 
performing timely backups because we can unmount the file system without impacting 
other file systems.
10.5.5 /usr
The /usr directory stores application software and supporting files. Like the root level, /usr 
comes with its own top-level directories: bin, etc, games, include, lib, lib64, libexec, local, 
sbin, share, src, X11R6. Aside from the binary files (executables), the directories contain 
documentation files (under/usr/local/man), library files, C header and object files, and pro-
grams that support the X windows system. The src subdirectory stores Linux kernel source 
files (as well as header files and documentation).
Many of these subdirectories are themselves broken into subdirectories. For instance, 
/usr/local might contain its own bin, etc, games, include, lib, man, sbin, share, and src 
directories. The difference between /usr and /usr/local is that /usr/local, historically, was 


The Linux File System

427
to store the portions of the software that were local to that computer whereas /usr would 
store software that was expected to be found on every computer in the network. Today, this 
is no longer honored and third-party software is often found in /usr/local rather than in /
opt or /usr.
10.5.6 /var
The /var directory contains system and software data. These data files will differ over time, 
thus the “var” name (variable). As with /usr, /var will most likely have a set structure of 
top-level directories. These will include account, cache, db, games, lock, log, mail, opt, run, 
spool, tmp, www, and yp. Some of these are worth commenting on.
The 
account
directory stores process account information as generated by the program 
accton
. The /
var/cache
directory is broken into several subdirectories. The 
man
subdi-
rectory stores recently accessed man pages. These are cached as man requires reformatting. 
A cached man page will take less time to appear. Examine the man pages shortly thereafter 
and it takes less time because the cache is storing the formatted version. Other cache subdi-
rectories are available for recent access by cups (the printer service), yum, and others.
The /var/games subdirectory stores temporary data created from a program in /usr/
games. The /var/lock subdirectory stores the files that software are currently accessing. 
These are known as 
lock
files because when one process accesses a file, it becomes locked 
for any other process.
The /var/log subdirectory stores log files that are automatically generated by the kernel 
and running software. The /var/mail and /var/spool directories store the mail files and 
print files, respectively.
Finally, the /var/www directory is often used if your computer is running a web server. 
This directory becomes the web server’s webspace. That is, all (or most) web pages are 
stored here along with other website files such as scripts, icon files (small images), and 
error pages.
10.5.7 Directories and Changes
If you examine the usage of these various directories presented in this section, you find 
that /home and /var are the two that tend to change over time. Because of this, it is impor-
tant to backup these two partitions in a timely manner. Thus, you would need to unmount 
the partition to be backed up, perform the backup, and then make it available again. 
While the partition is unavailable, you might not permit user logins so you have to be wise 
with the backup process. We will discuss backups in the next section as well as in Chapter 
14. The /usr directory will also change when you install or uninstall software. However, as 
changes to /usr are less frequent, backing up this partition will be a lesser priority.
If you are an active system administrator, you might also change /etc and /root frequently. 
You would generally find that other system directories, /bin, /sbin, /lib, /boot, and so forth, 
would not change over time unless you were to upgrade your operating system itself.
The /home and /var partitions not only change but grow over time. When you partition 
your storage space, it would be wise to allow plenty of room for growth. Alternatively, you 
could use an LVM so that you would not have to worry about repartitioning in the future. 


428

Linux with Operating System Concepts
Whether you use physical partitions or LVM, unexpected growth in these file systems may 
require that you add storage devices to expand their capacities. As a last resort, you might 
have to look for files to delete to free up space.
10.6 OTHER SYSTEM ADMINISTRATION DUTIES
Accessibility of the file systems is a primary concern of the system administrator. This 
amounts to ensuring that the needed file systems can be accessed by users when they log 
in. It also requires protecting the contents of the file systems. Protection takes on two dif-
ferent forms: ensuring that files have adequate permissions and backing up of files so that 
they can be restored in the case of corruption, deletion, or improper modification. In addi-
tion, the system administrator will have other file system-related duties. We have already 
discussed accessibility in terms of mounting and unmounting. In this section, we focus on 
the other duties.
10.6.1 Monitoring Disk Usage
The system administrator should occasionally monitor the status of the file systems, or at 
least the more critical ones. There are numerous Linux commands that provide a picture of 
file space usage and available capacity. We have already seen the df command, which pro-
vides a summary of the mounted partitions’ capacities. For more specific information, the 
du
(disk usage) command will provide the (estimated) size of individual files, directories, 
and entire partitions. The du command generally is of the form
du [options] 

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   156   157   158   159   160   161   162   163   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish