Linux Chapter 4

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

If you think your CPU is to blame for the unresponsiveness of your system:

-Run heavy programs when the load is low. -Prevent the system from doing unnecessary work. -Run big jobs with a low priority.

Tiny things which are not accounted for with the time command:

-the program executing is badly written or doesn't use the computer appropriately -access to disks, controllers, displays, all kinds of interfaces, etc. -reachability of remote systems (network performance) -Amount of users on the systenm amount of users actually working simultaneously -time of day

The first thing init does, is reading its intialization file

/etc/inittab

______ instructs init to read an initial configuation script for the environment, which sets the path, starts swapping, checks the file systems....

/etc/inittab

User names and passwords are listed in....

/etc/passwd file

When you see that one of your processes is eating too much of the system's resources, there are 2 things you can do?

1. Make the process use less resources without interrupting it. 2. Stop the process altogether.

Symbolic Link

A file that points to another file, and is used in this case, because it can be create4d and deleted without affecting the actual scripts that kill or start the services.

What does the command kill -1 show?

A list of signals.

Forking

A new process is created because an existing process makes an exact copy of itself. This child process has the same environment as its parent, only the process ID number is different.

Process ID for PID

A unique identification number used to refer to the process.

-h

After completing the shutdown procedure, this will halt the system.

-r

After completing the shutdown procedure, this will restart the system.

Job Control

Allows easy handling of multiple processes. This switches between the foreground and the background. When using this system, programs can also be started in the background immediately.

BIOS

Basic Input/Output System

Direct Loading

Boot method that has instructions that are used to directly load the operating system, with no intermediary code between the boot-loaders and the operating system's main files.

The sleep command simply waits.

By default the time is given in seconds.

Top command

Can be sued to display memory and swap use

grep

Command returns "-1" if no matches are found, upon which a message on the lines of "No files found" can be printed.

Run level

Configuration of processes

atrm

Deletes jobs, determined by the job number.

kill

End a process

Zombie Process

Every now and then things go wrong, even in good families. In an exceptional case, a process might finish while the parent does not wait for the completion of this process.

%n

Every process running in the background gets a number assigned to it. By using the % expression a job can be referred to using its number, for instance fg %2.

SIGHUP- Signal Number 1

For daemons: reread the configuration file.

cron

Gets information about which programs and when they should run from the system's and users' crontab entries.

The lower the nicer number, the more ______ a job is and the more resources it will take without sharing them.

Important

Ctrl+C

Interrupt (terminate and quit) a process running in the foreground.

SIGKILL - Signal Number 9

Interrupt the process. A process can not ignore this signal.

SIGINT- Signal Number 2

Interrupts the process. A process can ignore this signal.

A program with a high nice number is friendly to other programs, other users and system...

It is not an important job.

A window manager is a typica example:

It starts an xterm process that generates a shell that acceps commands. The window manager then denies any further responsibility and passes the child process to init. Using this mechanism, it is possible to change window managers without interrupting running applications.

atq

Lists the user's pending jobs.

Daemons are server processes that run continuously.

Most of the time, they are initialized at system startup and then wait in the background, until their service is required.

What are the 2 primary causes of bottlenecks in I/O performance?

Network I/O problems. Disk I/O problems.

chkcong or update-rc.d

Provide a simple command-line tool for manintaining the /etc/init.d directory hierachy.

fg

Puts the job back in the foreground.

at

Queue jobs for later exection.

bg

Reactivate a suspended program in the background.

command &

Run this command in the background (release the terminal).

regular_command

Runs this command in the foreground.

jobs

Show commands running in the background.

ps auxw | grep bash

Shows all processes with a process name of bash, the most common login shell on Linux systems.

Ctrl+Z

Suspend (stop, but not quit) a process running in the foreground.

Terminal or TTY

Terminal to which the process is connected.

SIGTERM- Signal Nubmer 15

Terminate the process in an orderly way.

Nice Number

The degree of friendliness of this process toward other processes.

Check the load regularly if you want to know what is normal.

The load depends on what is normal for your system.

Parent Process ID or PPID

The number of the process (PID) that started this process.

User uname of the real and effective user (RUID and EUID)

The owner of the process. The real ownere is the user issuing the command. The effective user is the one determining access to system resources.

Swapping or paging

The process uses the memory on disk or in swap space, moving contents of the physical memory to disk, thus reclaiming the physical memory to handle more processes. Slows downs system

Real and effective group owner (RGID and EGID)

The real group owner of a process is the primary group of the user who started the process. The effective owner is usally the same, except when SGID access mode has been applied to a file.

Processes end because they recieve a signal.

There are multiple signals that you can send to a process.

Automatic or batch processes are not connected to a terminal.

These are tasks that can be qued into a spooler area, where they can wait to be executed.

SUID and SGID exist because...

They exist to provide normal users the ability to execute tasks they would normally not be able to do because of the tigt file modes.

Most UNIX systems are likely to be able to run screen...

This is useful when you actually want another shell to execute commands. Upon calling a screen, a new session is created with an accompanying shell in/or commands as specified, which you can then put out of the way.

Bash shells are a special case:

This process list also shows which ones are login shells (where you have to give your username and password, such as when you log in in textmod or do a remote login, as oppsed to non-login shells, started up for instance by clicking a terminal window icon). Such login shell proceed wih at dash (-).

The priority or importance of a job is defined by its nice number.

Thrue.

Next to files, processes are the most important things on a UNIX/Linux system.

True

Bash offers a built-in time command that displays how long a command takes to execute.

True.

By default, tasks are put in a que where they wait to be executed until the system load is lower than 0.8.

True.

Interactive processes are initialized and controllecd through a terminal session.

True.

Linux makes it much easier to determine the exact source of most problems associated with starting up or shutting down your system.

True.

Not every command starts a single process. Some commands initiate a series of processes, and others are executed as a single command.

True.

Once Linux is installed on the hard drive of a system, the BIOS looks for a Master Boot Record (MBR).

True.

RUID and EUID are usually the same and they process has the same access rights the issuing user would have.

True.

The "-u" and "-a" options give additional information.

True.

The "top" program displays a more precise view by updating the results give by "ps" (with a bunch of options) once every five second, generating a new list of the processes causing the heaviest load periodically, meanwhile integrating a more information about the swap space in the use and the slate of the CPU.

True.

The BIOS program is written into the permanent read-only memory and is always available for use.

True.

The Microsfot operating systems, as well as various other proprietary operating systems, ar loaded using a chain loading boot method.

True.

The fork and exec mechanism thus switches an old command with a new, while the environment in which the new program is executed remains the same.

True.

The processes are not started automatically, there has to be someone connected to the system to start these processes.

True.

The ps command is one of the tools for visualizing processes. This command has several options which can be combined to display different process attributes.

True.

The return codes can be interpreted by the parent, or in scripts.

True.

The shell process is hard to kill.

True.

The values of the return codes are program-specific.

True.

When you put a job in the background, it usally means the job will take a long time to finish.

True.

With older versions of ps, it was not possible to start the program as a common user; unless special modes were applied to it.

True.

You can also use crontab -1 to display crontabs.

True.

You can change the order in which the services start up or are killed by changing the name of the symbolic link that refers to the script that actually controls the service.

True.

ps only gives a momentary state of the active processes, it is a one-time recording.

True.

There are a couple fo cases in which init becomes the parent of a process.

While the process was not started by init. Many programs, daemonize their child processes, so they can keep on running when the parent stops or is being stopped.

If you need to free the terminal after entering a command you:

You add a trailing ampersand.

If you don't want the grep command to find lines containing the string bash then you...

You use pgrep command.

What commands give indication about how many programs are waiting for I/O?

ps vmstat top

With no options specified what does ps do?

ps only gives information abou the current shell and eventual processes.

A process has a series of characteristics, which can be viewed with the ____ command.

ps.

The relations between processes can be visulized using the ____command:

pstree

Single User Mode

run level 1

system admin

run level S

UNIX was not made to shut down, but if you really must, use the ______ command.

shutdown

_____ starts all of the background processes necessary for the system to run by looking in the appropriate rc directory for that run level.

init

The ______ command writes a message to all connected users.

wall

To see which connected users accept messages from other users use ______.

who-w

The _____ command writes a message to a single user.

write

After the forking process, the address space of the child process is overwritten with the new process data. This is done through an _____ call to the system.

exec

When a process ends normally, the program returns its _______ to the parent.

exit status

If you want to stop a process because it hangs or is going totally beserk you can use the ________ command.

kill

Use the _____ command to send a signal to a process.

kill

You can read mroe about default actions that are taken when sending a signal to a process in ______________.

man 7 signal

When called, the ______ command will run using the access permissions of root, thus enabling a common user to edit the password file which is owned by the admin.

passwd


Set pelajaran terkait

NUR 131 HESI EAQ Practice Exam 3

View Set

Chap 9: Characterizing Risk and Return

View Set

ch 12&13-advertising and promo mix

View Set

Org Behavior Chapters 1-8 Review

View Set

N180- WK 7: Pharmacology Made Easy 4.0 The immune System

View Set

Chapter 16: the demand for resources

View Set

Collaborative Research (RCR-Basic)

View Set