Analysis of Linux System Launch Process (2)

xiaoxiao2021-03-06  56

Has you have been curious about the entire boot process of the computer? This time, what we want to discuss, is Linux from the boot to login, what happened?

If you want to know, when you just turn it on, you will put 1 in this register of 80x86, and all IP (Instruction Pointer) is 0, in other words, CS = FFF and IP = 0000, at this time, the CPU is based on the value of CS and IP, to the FFFF0H to execute the instructions placed in that place. At this time, since the FFF0H has reached the top of the high site, the FFF0H is always, it is always Play a JMP instruction to skip to a lower address. Then, the ROM BIOS will make some inspections like memory, keyboard, etc. ... and scan in our commonly known UMB (Upper Memory Block). See if there is a legal ROM existent (such as the ROM on the SCSI card). If you have, you will go to do something, after execution, continue the trip just now. In the end, read the first sector on the hard disk. Here, I assume that you started by the hard drive, so on the hard disk construct, its first sector is called MBR (Master Boot Record). Because a sector is 512 Bytes, and MBR 512 Bytes can be divided into two Some, the first part is the pre-boot area, accounting for 446 Bytes; the second part is partition table, accounting for one of the 66 BYtes. The role of the PRE-BOOT area is to see that partition is specified. Active, then read the Boot area of ​​that partition.

In terms of Linux, the average person is most often placed in MBR or SuperBlock if you put lilo in MBR, which is obvious that when reading MBR, LILO is executed, at this time, your screen will Boot: Next, let Load Kernel move. On the other hand, if you install lilo in Superblock, usually you will have a program that manages boot, maybe it is placed in MBR (like OSBS) or put it In a separate partition (Boot Manager like OS / 2). Receive LILO by this management boot, and then do the action of Load Kernel.

Ok, until now, we have said to the Action of Load Kernel. After being loaded into the Memory, Kernel then performs a series of PROBE surroundings, such as serial port, floppy disk, sound card, hard disk, optical drive, etc. ... Then, after this, kernel will start the init this process. Init This process's PID is 1, which is the ancestors of all processs.

Next? The system began to execute /rc.d/rc.s, here, we temporarily batches, first make a browse for the order of the probably initialization Script, please see the following process: init [1] rc.s Begin

The above process is clearly pointed out that in the shell script in rc.s, Rc.Serial will then perform Rc.m, Rc.m, contain Rc.inet1, Rc.inet2, Rc.Font, RC. LOCAL finally executed Login. In the following content, it will introduce these shell script from below. If there is a #, there is a # in each column, there are two people in the shell script, and the author plus Note, of course, there is no cover for the contents of the shell script, and the explanation of the command or content is written in front of the command or content. First by rc.s: ******** ************************************************************ *****

#! / bin / sh # # / etc / rc # # THESE COMMAVANDS Are Executed at boot time by init (8). # User Customization Should Go in /etc/rc.local.

Echo '======== rc.s is running! system initializing now !!! ========' Path = / sbin: / usr / sbin: / bin: / usr / bin

## Open all SWAP! The following / sbin / swapon -a means that the / etc / fstab is recorded in the DEVICE of SWAP.

/ SBIN / SWAPON -A?

Hey! The following instructions are very important. It is responsible for every time a fixed time, in order to use the SYNC to write back the disk, and make Update action. Use the PS to see those Process, you can see that Update has a bdflush. These two processings must exist. But don't cut it, else, if the system crash is, the information in the disk is not the latest .. ....

/ SBIN / UPDATE &?

Use echo -n >> to create a file, use RM -F files to test root partition

Is reta-only or readable

READWRITE = No if echo -n >> "Testing FileSystem Status"; THEN RM -F "Testing FileSystem Status" READWRITE = YES FI?

If root partition is Read-Only as FSCK's action, if not read-only

Instead, read-write, do the action after the following ELSE

IF [! $ readwrite = yes]; Then uses FSCK to check and repair the work of the file system, the two parameters -a, -a. -a meant: fsck will be based on records in / etc / fstab, Go check all file systems; and -a is the meaning of auto. When FSCK has a repair action, it will not ask you, and directly repair.

/ sbin / fsck -a -a?

If fsck has error, [$? -Gt 1] Inside the parentheses: 1 - File system errors corrected 2 - File system errors corrected, system should be rebooted if file system was mounted 4 - File system errors left uncorrected 8 - Operational error 16 - Usage or syntax error 128 - Shared library error obviously, if If any error is generated, the return value of the FSCK is greater than 1. In fact, I think I'm thinking, should be written into IF [$? -Ge 1] is better. Since it is wrong, the system should jump to single user mode, In the single user mode, it is mainly two things in /etc/rc.d/rc.k: Turn off SWAP and remove all file systems, and finally re-login. Usually, if the IF is below The paragraph will not be executed, and will jump to the following marked with Normal 1 IF [$? -Gt 1]; then echo echo echo "*************************** ****************** "Echo" fsck returned error code - reboot now! "echo" *************************** ********************* "Echo Echo / Bin / Login Fi

*************************** Normal 1 ****************** ******* Once there is no error after the FSCK check, there are three parameters of the ROOT Partition to re-Mount, and -w represents Mount to read and write, -n represents a file-system mount, but Write records in / etc / mtab, when the last / etc / mtab introduced, when we use the mount this instruction to bring a FileSystem Mount, / etc / mtab will record! Use -n This option allows MOUNT's actions, but will not be recorded., You can pick a lot of options. Here, the options we give to it are remount. Remount means: re-mount a flysystem this option that is already mount is usually It is used to change the FileSystem's read and write flag, especially the state of the FileSystem from Read-Only to the READ-WRITE.

Echo "Remounting Root Device with read-write enabled." / sbin / mount -w -n -o radount /?

In the previous case, all the root partition is read-only, and some of the work done, to the last instruction / sbin / mount -w -n -o transount /, only Root Partition Mount into Read-Write Have you seen the previous line?

IF [! $ readwrite = yes]; then ..... The following ELSE is related to this IF, in front of the IF block, the work is established in root partition for read-only The following thing is obvious. The following ELSE is the work made under the root partition for the read-write. If your root part is read-write, then the system will display the following information. Cat << What EOF is to display all the information before EOF on the screen: I think the following information is obvious, it said: Your root partition is taken into read-write by Mount, there is no way to check, to make check The action can be carried out smoothly, you must take the root partition mount into read-only! How do you do it? It's easy, just use

RDEV -R / 1 can be ...

Else Cat << EOF

*** Root partition has already been mounted read-write. Can not check! For filesystem checking to work properly, your system must initially mount the root partition as read only. Please modify your kernel with 'rdev' so that it does this. If You're booting with lilo, type: rdev -r / vmlinuz 1 (^^^^^^^^ ... or wherever your kenergy name is.)

IF you boot from a kernel on a floppy disk, put it in the drive and type: rdev -r / dev / fd0 1

THIS WIX THE PROBLEM * AND * ELIMINATE This Annoying Message.: ^)

EOF?

Below this instruction is not good, it is paused for 10 seconds, so that User can have enough time to read the information above.

SLEEP 10 FI?

Delete / etc / MTAB / ETC / NOLOGIN / ETC / UTMP

/ bin / rm -f / etc / mtab * / etc / nologin / etc / utmp?

Manufacturing / etc / utmp, this is a typical way to make an empty file. / Dev / null This node is very interesting, in a certain aspect, it is a bit like a "black hole". How to say? You can try Try to see the following instructions >> / dev / null, what happens after you use this instruction? Nothing happen, and the output of LS is like being thrown into the black hole, no shadow, no trace. That maybe you Will think about this? My answer is: I don't have a lot of use, but when you want to suppress the output information, you will get it.

CAT / dev / null >> / etc / utmp?

According to the description in FSTAB (FileSystem Table), automatically hangs the file system but at this time, because TCP / IP is not set yet, there is no NFS

Echo 'Mount FileSystem !!!' / sbin / mount -avt Nonfs?

Setting the system's clock. What do you do below is: Take a look at the / sbin / clock file is not executable. If you can execute, set the time in the CMOS as the system.

IF [-x / sbin / clock]; the echo 'set system clock' / sbin / clock -s fi? If there is no Mark, if there is no Mark, you will be changed every time ISSUE and MOTD, this should be a FAQ level. The problem ... Because I have my own Issue and MOTD, I have a #, I have been comment, if you have your own settings, you must get MARK below.

#echo> / etc / Issue #echo welcome to Linux / bin / uname -a | / bin / cut -d / -f3. >> / etc / ipsue #echo >> / etc / issue #echo "/ bin / uname -a | / bin / cut -d / -f1, 3. (POSIX). "> / etc / motd?

Next, rc.serial, as the name suggests, rc.serial is the work set by serial port in rc.serial, but it is also very simple, but it is not as direct as RC.s. In other words, readers should be at least "Slightly" know a little shell programming, so, if you still don't have shell programming readers, you should hurry to find a book, at the end of this article, I will ask some books, you can Go find these books ...

/ bin / sh /etc/rc.d/rc.serial echo '============== rc.s is finish Now !!! =========== ====== '??

Here, the last step of RC.s is to execute rc.serial. You can take a look at /rc.d/rc.serial. It seems to be a long look, but in fact, you must find it, this shell script There is a '#' front of most of the instructions, which represents these instructions, it will not be performed at all. So, really useful only more than a dozen lines! On the other hand, if you are With NIC, there is no big use of the rc.serial.?

************************************************* *******

#! / bin / sh # # /etc/rc.serial # Initializes The Serial Ports on Your System # # Version 2.01

echo '================= rsserial is begin !!! ================' CD / DEV

The first two lines in the three lines are set some variables. Due to this shell script, it is necessary to use the / bin / setserial -b instruction, or there is too much number of NODEs starting with CUA. Therefore, set them to a variable, is a good method. Especially ports = `echo coa? Cua ??` This is a smart way of writing, why not write into port = `echo coa *`? Under / DEV uses these two instructions, what is the difference between the observation output ... setserial = "/ bin / setserial -b" ports = `echo coa? Cua ??` echo -n "configuring serial ports. ... "?"

Below this line, people who have not studied shell programming can see you can't understand, but there is no relationship, $ {setserial} in this line will be replaced with / bin / setserial -b, and $ {ports} will be replaced Cua0 Cua1 Cua2 ....... CUA31, so the whole sentence is: / bin / setserial -b -w coa0 Cua1 Cua2 Cua3 Cua4 Cua5 Cua6 ... Cua31 What does this line of instruction do? In fact, it is just the work of interruption detection.

$ {Setserial} -w $ {ports}?

You saw the original comment below. When you have some special cards, you can remove the '#' of the corresponding part, so that you can do automatic settings. In fact, this is really no Many, most people's equipment is not much short, say about the serial port, less. # # Automatic Configuration # # uncomment the appropriate Lines Below to enable auto-configuration # of a particular board. Or Comment them Out To disable them .... #?

## 好, this we have more variables: Auto_IRQ, this will be used below.

Auto_IRQ = AUTO_IRQ?

## The following lines are very neat, they can be exchanged separately: ## / bin / setserial -b / dev / cua? Auto_irq skip_test autoconfig ## setserial is nothing, this instruction allows you to set the Serial Port And return ## action, like IRQ, I / O Port, etc. In general, everyone's computer ## usually only COM1-Com4, but if you want to add new port, the setserial is sent Used ## field.

# These are the standard COM1 through COM4 devices # # If you have an internal modeme with a Rockwell Chipset, add a "skip_test" # to the / dev / cua3 line below. (It's not added by default because it will # screw up people with 8514 displays). # $ {sETSERIAL} / dev / cua0 $ {aUTO_IRQ} skip_test autoconfig $ {sETSERIAL} / dev / cua1 $ {aUTO_IRQ} skip_test autoconfig $ {sETSERIAL} / dev / cua2 $ {aUTO_IRQ} skip_test autoconfig $ { sETSERIAL} / dev / cua3 $ {aUTO_IRQ} autoconfig # These are for the first AST Fourport board (base address 0x1A0) # $ {sETSERIAL} / dev / cua4 $ {aUTO_IRQ} autoconfig $ {sETSERIAL} / dev / cua5 $ {aUTO_IRQ } AutoConfig $ {setserial} / dev / cua6 $ {auto_irq} AutoConfig $ {setserial} / dev / cua7 $ {auto_irq} autoconfig

# These are for the second AST Fourport board (base address 0x2A0) # $ {SETSERIAL} / dev / cua8 $ {AUTO_IRQ} autoconfig $ {SETSERIAL} / dev / cua9 $ {AUTO_IRQ} autoconfig $ {SETSERIAL} / dev / cua10 $ {Auto_irq} AutoConfig $ {setserial} / dev / cua11 $ {auto_irq} AutoConfig?

## From here, I omitted a large paragraph, because this large paragraph is supporting special cards.

# THESE ARE THE 3rd and 4th ports on the accent async board. # $ {Setserial} / dev / cua12 $ {auto_irq} autoconfig # $ {setserial} / dev / cua13 $ {auto_irq} autoconfig #?

?.............

## 好, we jump off a big paragraph until you see the following annotations. ## If you want to specify the IRQ, I / O Port, and specify the model of Chip with a manual method ## 那 你You can take the following to the '#' in front of the line and make appropriate modifications, such as ## you are using a new 16550 or 16550a instead of 16450, then you can use the manual method to specify the manual method below. In fact, the option with AutoConfig and Autoirq ## can be used, and there is no need to manually. Unless it is not detected.

######################################################################################################################################################################################################################################################################################################## ############# # # manual configuration # # if you want to do manual configuration of one or more of your # serial ports, uncomment and modify the relevant lines. ###### ######################################################################################################################################################################################################################################################################################################## #######

# {Setserial} # $ {setserial} / dev / cua0 uart 16450 port 0x3f8 IRQ 4 # $ {setserial} / dev / cua1 uart 16450 port 0x2f8 IRQ 3 # $ {setserial} / dev / cua2 UART 16450 Port 0x3e8 IRQ 4 # $ {setserial} / dev / cua3 UART 16450 Port 0x2e8 Irq 3........

## ok, here, rc.s and rc.serial have ended, because the relationship between the time, rc.m ## rc.inet1, rc.inet2, rc.font, Rc.local will be introduced later.

Echo "DONE." $ {setserial} -bg $ {ports}

echo '====================== rSERIAL IS Complete !!! ==================== = '??

* About Shell Programming Book:

Title: The UNIX C Shell Field Guide Author: Gail Anderson and Paul Anderson Publisher: Prentice Hall Edition: 1986 ISBN: 0-13-937468-X

This is the c-shell of Bible, who wants to learn C-shell, can go to this book.?

Title: UNIX Shell Programming Authors: Stephen Kochan and Patrick Wood Publisher: Hayden Edition: 1990 ISBN: 0-672-48448-X

Hey! This book is based on the bourne shell, the content is in-depth, readers can easily understand the content of this book, and master the essence of Bourne Shell. In addition, this book also mentioned the Korn shell, which is generally one. This is a good book worth watching.?

* How to contact the Author:

E-mail address: jhsu@csie.nctu.edu.tw u8217017@cc.nctu.edu.tw

Dormitory: Jiaotong University House 317R

..??

Discussion of Linux Power Contributions CCCA Training 86 Xianghua

In the last introduction, we have already read the two shell script of RC.s and Rc.Serial. Now we will put the remaining shell script to introduce. First, look at all processes:?

Init [1] rc.s begin rc.serial begin rc.serial end rc.s End <- Next time we explain here init [1] Enter Runlevel 5 rc.m begin rc.inet1 begin rc.inet1 End RC. INET2 begin rc.inet2 End rc.font begin rc.font end rc.local begin rc.local end rc.m end login?

This main part can be divided into two: because initTab will be read, so INITTAB will be listed as the first part of the first part, and the second part is RC.M, Rc.Font, RC. Local's instructions for these shell script. (rc.inet1, rc.inet2 These two Shell script will explain separately after the network), let's look at the influence! Take a look at the above process, in the first One line: init [1] is that the init this process is started, it will read the / etc / inittab file to complete the system's startup. From here, we have seen that Linux is indeed the characteristics of SVR4 and SunOS, INITTAB file, is not existing in the SunOS system, but it is a typical file of SVR4. Init This process will enter different Run-Level and launch different processs in accordance with the contents recorded in / etc / inittab. So INITTAB The importance is visible. What is Run-Level? The so-called run-level is the system defined a lot of different levels, and the system will start different resources with the difference of Level. Let us look at it now. / etc / inittab: In / etc / inittab file, each column is an entry point, if we carefully observe each column, then we will easily find that each column of / etc / inittab can be ":" This character is divided into several fields. The format of these columns is as follows: ID: Runlevels: Action: Process

And their representatives are as follows:

ID: Identification symbols composed of two unique characters, in a new Unix system, is not limited to only two characters.

Runlevels: Points the Action in one field below and the processs in the next field will be performed in those RunLvel. The legal value of this column has 0, 1, 2 ... 6 s, and s. After the startup program, SuperUser can use Telinit instructions to change the system's RunLvel. Because in Linux, Runlevel's preset value is 5 (you will see), so only those in each column are 5 If this value, the back Process will be boot. So, we can imagine: "Due to the different system Runlevel, the process is not the same, so the resource started by the system is in each different Runlevel. There is a difference.

Action: This field is a bit complicated. When INIT is recorded in this field, the action taken by Process is the action of Process, and the legal action has the following:

INITDEFAULT: Indicates that the system is started, and if you have entered the Run-Level value, for example, we can find the following column in / etc / inittab: ID: 3: INitDefault: Obviously, the system will start, enter Runlevel is 3 mode. Of course, you can try 3 change to 4, if you change it to 4, it will execute /etc/rc.d/rc.4, that is, Run XDM. XDM has a chance If you will introduce you ...

Sysinit: This process will be executed when the system is started. And there are boot and bootwait's processs before all Process, must wait until these anctions are executed for the Sysinit, they can perform it.

Wait: After starting a processs, if you start another process, you must wait until this processs ends before you can continue.

Respawn: Even after the end, it will be re-started. The most typical example is getty (for agtty in Linux). Take a look at the following loop: - getty -> login -> shell -> Logout - ^ | ??????????????????????????????? | <- ------------------------------------- |

Even after getting at Getty, it will be restarted.

Ctrlattdel: I must have someone to achieve the purpose of making the system shutdown in the three keys on the keyboard, now we have seen this column in / etc / inittab:

Ca :: ctrlatdel: / sbin / shutdown -t3-rf now

So, when we press these three keys, INIT will receive SIGINT SIGNAL, then perform Shutdown's movements, we'd better develop Ctrl-Alt-Del to make the system shutdown habits, especially Operating systems in single users, like OS / 2, even Windows 95, Shutdown almost all standard shutdown programs, not to mention multi-user multitasking Linux, so this instruction is be sure to be familiar.

In addition to the few Actions above, there are some legitimate Actions, but these Actions don't need to pay too much. It is possible to use Man INIT to query when you use.

Process: This column can be a Shell Script or an executable program.

Ok, when we understand the meaning of / etc / inittab, you have to understand / etc / inittab is a relaxing job. In / etc / inittab file, we can see the following paragraph

C1: 12345: Respawn: / sbin / agty 38400 TTY1 C2: 12345: Respawn: / sbin / agharge 38400 TTY2 C3: 45: Respawn: / sbin / agharge 38400 TTY3 C4: 45: Respaw: / sbin / agharge 38400 TTY4 C5: 45: Respawn: / sbin / agharge 38400 TTY5 C6: 456: Respawn: / sbin / agty 38400 TTY6

Simply, the system will make six virtual console after starting. I think everyone should have a trial Ctrl-Alt F1 - F6 can switch between these six console; if you want to temporarily return when you use xwindows When you get under Console, you can use the three keys of Ctrl-Alt F1 - F6. If you want to go back to XWindows, you can return to XWindows with Ctrl-Alt-F7. Basically, for Memory comparison Less people, you can remove so many virtual console, then you can remove the few columns above. In the front, we also mentioned that the preset Runlevel can be changed from 5 to 6, for Beginner, The system directly enters XWindows directly, it is a good setting method ...

After introducing / etc / inittab, we look at RC.M! From the previous process, we see that RC.M contains four shell script, where rc.inet1 and rc.inet2 are related to the network. Type; Rc.Font is a font setting, while Rc.Local can put some daemon you want to boot.

Let's take a look at Rc.m, in accordance with the proportion, there are two "#" in front of the comment. There is only one "#" for the original annotation:

#! / bin / sh # # rc.m this file is executed by init (8) When the system is being # ionized for one of the "multi user" Run Levels (IE # levels 1 THROUGH 6). IT Usually Does Mounting Of file # systems et al. # # Version: @ (#) / etc / rc.d / rc.m 2.02 02/26/93 # # author: fred n. van kempen, # heavily modified by patrick volkeerding ### Show into multi-user mode

Echo "Going MultiUser ..."?

## 的 列 意 的 列: If you don't move in the text mode, there is no action in 15 minutes, the screen will be automatically dark, simply, it is the function of Screen Saver.

/ BIN / SETTERM-BLANK 15?

## Execute Crond Daemon. Don't say, crones play a very important role in the system, ## It is responsible for every time you have been going, you will go see / var / spool / cron / crontabs have those File ## 要Operation, these File often have a fixed time, such as: 1 month, every ## 天晨, etc., we can use the usual editor to make a file, the format is as follows: ## ## 分时 日 星 ### Example, 59 23 31 12 * / etc / wall happy_new_year ## Every year, at 11:59, the USER is sent to each system. ## ## nw 中e #着 #着 着着 We can use the crontab this instruction to put this file in ## / var / spool / cron / crontabs. We can take a look / var / spool / cron / Crontab ## There is a root file, see the inside: ## ## 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55 * * * * / usr / LIB / ATRUN ## ## So you see, the AT command mentioned in the first two periods is a five minute to be Run once ### and raise a simple example: Let's first use the general text editor Creating a file called crontest ##, the content is as follows: ## ## 5 * * * rs -la ~ / >> ~ / hehehaha ## ## Next, we type the following command: crontab cronte ## When you know, you will perform LS -LA every five minutes, add your home directory ##. ## ## Of course! This example is simply meaningless :) However, since everyone knows the basic principle, ## Use crontab, AT these instructions, you can simplify some system management actions, while executing ## Some work, it will also be more flexible.

/ usr / sbin / crond -l10 >> / var / adm / cron 2> & 1?

## If / etc / hostname cannot be read, it will regard DarkStar.Frop.org as the content in Hostname ##. Hone other words, the following three columns are not tight ......

IF [! -r / etc / hostname]; the echo "darkstar.frop.org"> / etc / hostname fi?

## Part below from the IF to the Fi, mainly in executing rc.inet1, rc.inet2. This ## is a network set job, especially rc.inet2, starting a lot of daemon, There are too many things that ## to involve it. Like Subnet and Netmask, etc. ... Similar to this concept, ## is not three words, you can finish it, so you will be left later. IF [ X /etc/rc.d/rc.inet1]; THEN / BIN / HOSTNAME `CAT / ETC / HOSTNAME | CUT-F1 -D.` / bin / sh /etc/rc.d/rc.inet1 / bin / sh /etc/rc.d/rc.inet2 else / sbin / hostname_notcp `CAT / etc / hostname | cut -f1 -d.` / usr / sbin / syslogd / usr / sbin / klogd / usr / sbin / lpd fi?

## In some cases, some applications tend to create a lock file. If these ## lock files still exist after rebooting, then it is very bad. So, below is in ## These delete the action of the Lock file, and throw some output information to / dev / null. ## In the previous period, we have mentioned / dev / null, and also mentioned # 信息 信息 输 输# Method. Now we have seen an example ...

/ BIN / RM -F / VAR / SPOOL / LOCKS / * /VAR/SPOOL/UUCP/LCK.. /TMP/.x*lock 1> / dev / NULL 2> / dev / null?

## If you have a hunt this game, then there will be a socket type file in / TMP. ## We have to delete it to start another game ...

IF [-r / tmp / hunt -o -r /tmp/hunt.stats]; The echo "Removing your stale hunt sockets from / tmp ..." / bin / rm -f / tmp / hunt * fi?

## Sets the link and cache of Share Library. This instruction only has superuse to use ##, it is also quite important. In case your /etc/ld.so.cache is very unfortunate Corrupt, ## then we also You can use this instruction to let it re-link, first delete /etc/ld.so.cache, ## and re-manufactured with ldconfig -v.

/ sbin / ldconfig?

## Start sendmail daemon, and let it take a look at SPOOL for 15 minutes, handle the send and receive letters

IF [-X / usr / sbin / sendmail]; THEN Echo "Starting Sendmail daem" ... "/ usr / sbin / sendmail -bd -q 15m fi?

## If /etc/rc.d/rc.font is readable, execute rc.font this shell script, ##, this shell script is mainly to set the font of the screen under Text Mode

IF [-r /etc/rc.d/rc.font]; THEN /ETC/rc.d/rc.font fi?

## In system management, we often put some local things in one place, so that you will not be confused with the original things. At the same time, because the speed of Local is always compared to the speed of the update version ## fast, In this case, something that is often changed can also be placed in the area of ​​LOCAL, so ## management is more convenient. Maybe you also noticed: Why there is / usr / bin and ## / usr / local / bin The point. I think that something like my compile is, if ## I feel is not bad, you can put it in / usr / local / bin, because it is new, so I am put it on / USR / local / bin. Of course, this is just a personal preference, you have to put it there ## is ok, just find it, easy to use and manage it. ## The same, if we want to start some new Daemon or Shell Script, then put it in ## is a good choice. ## The following list is to perform the settings in rc.local, usually some daemon or shell ## script / etc / rc.d / rc.local ?

# All done.?

Here, rc.m is over, let's take a look at Rc.Font executed from rc.m and

Rc.local ...

Here is the content of rc.font:

#! / bin / sh # # this selections your default screen font from among the ones in # / usr / lib / kbd / consolefonts. #

## I want the command of the column below to set the font in the console, you can ## change into your favorite font. Or you can also use the fontconfig to change.

SetFont / USR / LIB / KBD / consOLLONTS / DEFAULT8X16??

After reading Rc.Font, let's take a look at Rc.local content. What I want is: rc.local

After all, it is the area you set, so everyone may not be the same, I'm for me, because I am Run

Some Daemon, so it may not be the same as everyone. Therefore, rc.local can be referred to.

Here is my rc.local:

#! / bin / sh # Put Any Local Setup Commands in here # Running SELECTION?

## lpd is the Daemon for control the printer. If you want to use the printer in Linux, this daem must be ## To be started, there is also a modification / etc / printcap. Detailed situation is going to see Print-HOWTO

echo -n "lpd" / etc / lpd?

## httpd is the WWW Server Daemon. I must have used Mosaic, Netscape and other ## browsers. But if we want to build your own WWW server, httpd must be executed.

Echo -n "httpd" / usr / local / etc / httpd / src / httpd?

## The era of WWW has not come before, and gopher can say that it is the most convenient information index function. Even if ## is now, Gopher still holds a place, here, because I have a Gopher ## server, so Gopherd It is necessary to be started.

echo -n "gopherd" / usr / local / sbin / gopherd -u number?

## This instruction is mouse to do CUT & PASTE under Console

echo -n "Running Selection ..." Selection -t MS & Echo '"

转载请注明原文地址:https://www.9cbs.com/read-121091.html

New Post(0)