1. Trang chủ
  2. » Công Nghệ Thông Tin

UNIX System Administration A Beginner’s Guide PHẦN 5 potx

70 296 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 70
Dung lượng 1,74 MB

Nội dung

260 UNIX System Administration: A Beginner’s Guide ● Process This field contains the actual program that will be invoked when the run level is entered. Typically, this invokes the startup scripts that are associated with each run level. 1-Minute Drill ● Explain how the /etc/inittab files for Solaris, HP-UX, and Linux are similar and how they are different. ● What’s the difference between run levels 2 and 3? Figure 9-3 The /etc/inittab entry format Keyword Meaning respawn Start the process and don’t wait for it to terminate. Restart the process when the run level is entered. wait Star the process, but wait until it terminates. once When the run level is entered, invoke the process and don’t wait for the process to finish. If the process terminates, don’t restart it. boot Process this entry only when the boot phase is started bootwait Process this entry when the system enters multi-user mode from single-user mode after the system has booted. powerfail Invoke this entry when the process associated with this entry is sent a powerfail signal. off If the process of this entry is currently running, shut down. Otherwise, do nothing. initdefault Specifies the default run level. Table 9-5 Common /etc/inittab Action Keywords ● They all use the same general syntax but the services each one starts are different. ● Run level 2 and 3 are both multi-user mode run levels but 2 doesn’t include networking services. TEAMFLY Team-Fly ® Module 9: System Operations 261 9 The Default Run Level The default run level is defined within the /etc/inittab file. When the system is rebooted or started when the power is applied to the system, the system is restored to the default run level—which for most systems is multi-user mode (run level 2). If a Linux system is configured to support X11 on the console device, the default run level is 5. It is at this level that X11 support is active and users can access the console using a standard X11 login application. Without X11 support configured, the default run level is 3 and the user receives the standard login prompt. On Solaris and HP-UX, the sample default run-level entry looks like this: is:3:initdefault: While on Linux, the default run-level entry is this: id:5:initdefault To change the default run level, change the 3 or 5 value for the run level. Once the default run level has been changed, use the init command with the q option to reread the /etc/inittab configuration file. List the Current Run Level It is important to know which run level the system is at. This is especially true when doing maintenance work at a certain level (such as single-user mode) and the system needs to be reported to the default mode. In this case, the administrator should check to make sure that the system is at the correct level. To show the current run level on both Solaris and HP-UX, use the who command. Thus, who –r shows . run-level S Feb 3 20:09 S 2 3 In this example, the current run level is (S), which stands for single-user mode. On Linux, use the runlevel command: runlevel 3 5 This shows the previous and current run levels. In this example, the system was previously at run level 3 (multi-user mode without X11), but now the system is at run level 5 (multi-user mode, with X11). Single-User Mode When the system is placed in “s” (S) or single-user mode, regular users are not able to log into the system. Also, no networking facilities or typical operating system services are available. In general, this mode is used to conduct system maintenance tasks such as checking the file systems with fsck, adding new services, and a host of other related tasks that must be accomplished when the system is in a quiescent state. To place the system in this mode when the system has already been booted, issue the following command: init s The following will be displayed when this command is run on a Solaris system: INIT: New run level: S The system is coming down for administration. Please wait. Unmounting remote filesystems: done. Print services stopped. Feb 3 20:09:46 dino syslogd: going down on signal 15 Killing user processes: done. INIT: SINGLE USER MODE Type control-d to proceed with normal startup, (or give root password for system maintenance): As the last step in the process, the system prompts for the root password. This is a necessary precaution so that unauthorized users can’t access the system when placed in this mode. When the correct password has been entered, 262 UNIX System Administration: A Beginner’s Guide a shell prompt is displayed. When a Linux system is brought to single-user mode, it doesn’t prompt for the root password; instead, it gives a shell prompt. On HP-UX, different messages are displayed when single-user mode is entered. To bring the system to the default run-level, type a ^d ( CTRL-D) or exit the shell. At this point, the system will continue to boot to multi-user mode, which is the default run level for most systems. Boot to Single-User Mode If the system must be placed in single-user mode (the system is currently at the boot prompt)—due to some problems or because some maintenance task must be performed—use the –s option that is available with most boot loader programs. Table 9-6 shows the appropriate boot command for each operating system. For example, at the Linux boot prompt, use the linux -s command to boot the system in single-user mode. Project 9-1 This project will familiarize you with the commands from this module and give you firsthand experience with them on your own system. Step-by-Step 1. Display the current run level for your system. On Solaris or HP-UX: # who -r Or on Linux: runlevel Module 9: System Operations 263 9 O/S Boot Command Linux linux –s Solaris boot -s HP-UX b-s Table 9-6 Single-User Boot Commands 264 UNIX System Administration: A Beginner’s Guide 2. Display all the processes running on your system and identify the init process and its process ID: # ps -e 3. Determine what users are currently logged onto your system: # who 4. If you are the only user logged on, shut down your system giving yourself a 1 minute warning before shutdown. (If other users are logged on, perform this step at a later time when the system can be shut down without inconvenience. If this system must remaining running except for emergency maintenance, skip this step): # shutdown -g 60 "##### testing shutdown process in 60 seconds #####" 5. Check your system to see when the most recent shutdowns occured: # grep shutdown /var/adm/messages (Linux/var/log/messages) 6. Restart the system in default mode # reboot 7. After logging back on to the system, display the default run level in the /etc/inittab file for your system: # grep initdefault /etc/inittab 8. Display the current run level for your system. (This should be the same as the default run level.) # who -r Module 9: System Operations 265 9 Mastery Check 1. Which system mode is used for system maintenance? A. Multi-user mode B. Single-user mode C. Maintenance mode D. Reboot mode 2. The normal or default running mode for most UNIX systems is __________. 3. What process has the process id of 1 and is known as the father or master system process? A. Init B. Kernel C. Boot D. Shutdown 4. What keyword do you use in an inittab entry for a process you want to restart whenever it terminates? A. Respawn B. Init C. Reboot D. Boot 5. What user mode is your system in if it displays the following output from a who -r command? . run-level 3 Dec 8 10:41 3 0 S 266 UNIX System Administration: A Beginner’s Guide 6. Which command will restart the system after you run the command to bring the system down? A. Respawn B. Halt C. Reboot D. Shutdown 7. Which directory contains script files that init runs at startup? A. /etc/initab B. /etc C. /etc/script D. /etc/startup 8. Which init command is equivalent to the halt command? A. init 0 B. init 3 C. init 6 D. init s Mastery Check Module10 The TCP/IP Suite Critical Skills 10.1 Uncover the General Seven-Layer OSI Network Model 10.2 Discover the TCP/IP Protocol Architecture 10.3 Learn About the Address Resolution Protocol Copyright 2002 by The McGraw-Hill Companies, Inc. Click Here for Terms of Use. A s a system administrator, you will be required to handle problems that may affect one or more networked UNIX systems or involve network services at a lower level where protocol operation knowledge is necessary. As a result, direct interaction with TCP/IP and related services might be needed. Therefore, you will need a good understanding of TCP/IP, associated protocols, and applications. Today, many corporations, institutions, and other organizations use TCP/IP extensively and universally to address all aspects of network connectivity in a multi-vendor environment. It is the protocol family of choice with networking manufacturers, operating system vendors, and users alike. In fact, the world’s largest network, the Internet, uses TCP/IP exclusively. UNIX was the first popular operating system to use TCP/IP, and TCP/IP continues to be the most widely used set of networking protocols for this and other operating systems. If you have accessed the Web using a browser, transferred files using FTP, accessed a remote NFS file system, or sent email via the Internet, you have indirectly used TCP/IP. Fundamentally, TCP/IP provides a standard way to deliver information from one system to another without concern for operating system differences and network hardware characteristics. TCP/IP is an acronym that stands for two separate protocols: Transmission Control Protocol (TCP) and Internet Protocol (IP). However, TCP/IP generally refers to these protocols, plus a suite of related protocols and services. For example, the File Transfer Protocol (FTP) uses TCP/IP and provides a basic file transfer facility between a pair of systems. If the system supports TCP/IP, it is generally assumed to support FTP and a host of other protocols and services as well. Today, the TCP/IP suite is supported on every major computer operating system available. For example, it is supported on HP-UX, Solaris, Linux, AIX, and many more. As such, it is considered the most popular networking protocol, and many of the same TCP/IP services are available on different versions of UNIX. This is good news, because many of the core functions of TCP/IP and applications are the same across different versions of UNIX. The operations of TCP/IP are independent of operating system or computer platform. The protocols hide the underlying operating system details and provides a common framework for establishing connectivity among systems. For instance, an FTP client program is normally available across most implementations of TCP/IP, and a result of using this program, which implements the FTP protocol, is that data files may be transferred between dissimilar systems. In other words, a file may be copied from, say, a Windows machine to Solaris (or vice versa) without the need to worry about how the actual data of the file is stored with each operating system. The client 268 UNIX System Administration: A Beginner’s Guide Module 10: The TCP/IP Suite 269 10 and/or server processing the file automatically handles the file structure differences and adjusts accordingly. The TCP/IP suite is built on industry standards and is documented quite completely in Request for Comments (RFCs) papers. These documents are widely available on the Internet from several Web sites, but the general authoritative source of such information can be obtained from http://www.ietf.org/ rfc.html. TCP/IP is defined within an open standards organization, which means that the protocols will remain open and common, and no single vendor can own the protocols or develop proprietary extensions. TCP/IP is independent of any data link protocol and can be used with many different networking technologies, including FDDI, Ethernet, ATM, token ring, Frame Relay, and SMDS. TCP/IP makes it possible to build a truly heterogeneous network consisting of products and network technologies from many different vendors and sources. In fact, the Internet, which is considered the world’s largest network, consists of devices from many networking vendors that operate together in a uniform fashion. That’s not to say the Internet doesn’t have its share of networking issues or problems, but, for the most part, many would agree that interoperability between equipment vendors isn’t a major factor for the established core set of TCP/IP, protocols, and applications. From a system administration point of view, many of the tools used to administer, monitor, and configure TCP/IP on systems are consistent across most UNIX operating system versions. However, one issue that can be a problem is that each UNIX operating system vendor can and does implement nonprotocol details differently. For example, the way IP address and hostname information is stored on each network device or UNIX systems is not covered by any RFC standard, nor should it be, since it is an implementation detail. Thus, for Solaris, the system name is stored in a file called /etc/hostname.device, where device is the name of the default LAN interface. Other operating systems use different files or other mechanisms. The present TCP/IP suite provides a mechanism to dynamically assign IP addresses to devices, and it also mandates that they be uniquely assigned to each device attached to the network. However, IP addresses are stored on a local system and are not a protocol matter, but rather a network management or system configuration issue, which is traditionally resolved at the operating system level. Each operating system vendor provides its own solutions to how IP address information or other operating system parameters are to be stored. Since operating systems are completely nonstandardized between vendors, the name of the file or its location (or even the presence of a hostname file) varies between different operating systems and releases. [...]... the application layer and uses TCP RADIO This is the radio broadcast facility, and operates on the application layer and uses UDP SMTP The Simple Mail Transfer Protocol provides the mail delivery mechanism that is used by many electronic mail packages and is the standard mailing protocol for the Internet The sendmail system program implements SMTP and is responsible for mail propagation between systems... operates on the application layer and uses TCP Additional Services Many public domain TCP/IP services and applications are also available via the Internet Some of the resources available are improvements over the existing core set of services, while other applications provide new services and features Table 10-2 lists some of these TCP/IP applications AIM ARCHIE AM FL Y AIM is one of several popular... network Conceptually, a user calls another machine to request data transfer After all the details of the connection setup are complete, data transmission can occur between applications From an application perspective, the TCP connection looks and behaves as if a dedicated hardware link has been established However, this is only an illusion provided by the TCP streams interface G G ARP, RARP, DHCP, ICMP,... provides a shell to the remote system, and operates on the application layer and uses TCP RWHO RWHO provides a list of logged-in users on a remote system This command is similar to the UNIX who command and operates on the application layer and uses TCP Module 10: The TCP/IP Suite 279 RWALL RWALL provides a way to write to users on a remote system This command is similar to the UNIX wall command and operates... Administration: A Beginner’s Guide Figure 10-2 TCP/IP suite and model End-User Tools The end-user tools, which are common to many UNIX system implementations of TCP/IP, are applications that are generally available to normal system users As a result, these tools do not require system root privileges for operation For example, general users without any special consideration from an administration standpoint can invoke... includes additional higher-level protocols that exist above the network layer and provide the necessary details to ensure that applications can communicate For example, the File Transfer Protocol (FTP) defines how files and associated information are transmitted across the network The protocol Module 10: The TCP/IP Suite 2 75 handles all the details related to user authorization, naming, and data representation... Token Ring) and higher-level protocols such as IP ARP maps data link (that is, hardware interface) addresses to IP addresses The Reverse Address Resolution Protocol (RARP) is used to go the other way; it maps IP addresses to data link protocol addresses ARP and RARP are described fully later in this section ARP/RARP operates on the network and data link layers DHCP The Dynamic Host Configuration Protocol... (such as cables and connectors) and provides transmission of a bit stream that involves controlling voltage characteristics to produce the appropriate signals for each of the networking standard Examples include cabling for Ethernet, Fast Ethernet, FDDI, and Token Ring Cabling standards such as 100Base-T, 10Base-T, fiber, and coax, for example, are implemented on this layer 1-Minute Drill G G G G At which... doesn’t support a robust authorization mechanism or command set TFTP is used mainly to download system configuration information or data This service operates on the application layer and uses UDP or TCP 10 280 UNIX System Administration: A Beginner’s Guide WHOIS WHOIS is a white pages lookup utility The WHOIS service will search for individual users and other information from standard Internet servers... may emit an RST (reset) packet that automatically causes the connection to be closed Closing a TCP Connection Please note that it takes three segments to create a TCP connection, and four additional segments to shut it down A total of seven messages are required to operate a TCP connection, not including any data transfer segments State Machine The operation of TCP is best described using a state machine . Administration: A Beginner’s Guide End-User Tools The end-user tools, which are common to many UNIX system implementations of TCP/IP, are applications that are generally available to normal system. on a remote system. This command is similar to the UNIX wall command and operates on the application layer and uses TCP. RADIO This is the radio broadcast facility, and operates on the application. a local system and are not a protocol matter, but rather a network management or system configuration issue, which is traditionally resolved at the operating system level. Each operating system

Ngày đăng: 13/08/2014, 04:21

TỪ KHÓA LIÊN QUAN