linux system commands Profile

System commands to exclusively control system, and make everything work. All such as login (console complete user authentication phase) or bash (providing interaction between users and computers) such programs are system commands. Therefore, and their associated files are also particularly important. This category has the following file so that users and administrators interested.

/etc/lilo.conf

The system contains a default boot command line parameters, as well as different mappings used for startup. You press the Tab key, you can see the list at the time of the LILO boot prompt.

/etc/logrotate.conf

Maintenance / var / log directory log files.

/etc/identd.conf

identd is a server that implements TCP / IP proposed standard IDENT user identification protocol in accordance with RFC 1413 document specified. Identd principle of operation is to find a specific TCP / IP connections and returns the process owning this connection the user name. Alternatively, it can also return other information, instead of a user name. See the identd manpage.

/etc/ld.so.conf

Configuration "Dynamic Linker" (Dynamic Linker) of.

/etc/inittab

Chronologically, this is the first UNIX configuration file. The first program started after a UNIX machine is open init, it knows what to start, this is due to the presence of inittab. When you run level is changed, init reads the inittab, and then start the main control process.

1. File Format

init process will view this file to start the child process to complete the system boot ./etc/inittab describes a process is started under a situation after the completion of the system boot or start when the system boots. He also recorded line by line by the composition a. the line that begins with # is a comment and will be ignored.

Recording format is:

id:runlevels:action:process

id field is a string of 1-4 characters, the string must be unique, i.e., can not have two records with the same field of the id field is a flag field .id, each distinguished by its record. Note for gettys or other login process is, id domain must be a tty suffix of the corresponding tty, eg for tty1 it, id field should be 1. Check your / etc / inittab, like this record will find the following:

.........

1:2345:respawn:/sbin/mingetty tty1

2:2345:respawn:/sbin/mingetty tty2

3:2345:respawn:/sbin/mingetty tty3

.............

runlevels field is a list of run levels, the available run levels are:

0 ---- shutdown

1 ---- single-user mode

2 ---- multi-user mode without NFS of

3 ---- complete multi-user mode

4 ---- not used

5 ---- X11

6 ---- reboot the system

S ---- single-user

s ---- with S

The action field is a predefined action, the action can be used are:

respawn

Immediately after the restart process terminates (eg getty process)

wait

Once the process started after entering the specified run level, then init will wait for its termination

once

Once the process started after entering the specified runlevel

boot

Start at system boot process, runlevels field is ignored

bootwait

At system boot process is started, and then waits for its termination init, The runlevels field will be ignored

off

This action does not do anything

ondemand

There is a special class called the run ondemand runlevel, comprising a, b and c. If a process is marked ondemand runlevel, then when the switching to claim OnDemand runlevel will start the process, but does not actually change runlevel

initdefault

This action tagged initdefault runlevel field specifies the entries into the system boot operation completion stage

sysinit

在系统引导时起动这个进程.而且在所有的boot和bootwait项之前起动.process域将被忽略

powerwait

在电力中断时起动这个进程.通常会由一个与连接到计算机的UPS系统对话的进程通知init电力切断.init在继续之前将等待这个进程结束

powerfail

同powerwait类似,但是init不会等待这个进程结束

powerokwait

一旦init被通知电力已经恢复,将起动这个进程

powerfailnow

当init被告知UPS的电力亦将耗尽时起动这个进程

ctrlaltdel

当init接到SIGINT信号时起动这个进程.一般是按下了ctrl+alt+del这个组合键

kbrequest

当一个特殊的键盘组合键被按下时起动这个进程

process域指定了将运行的进程,可以有参数.如果这个域以 + 开头,表明init将为这个进程更新utmp/wtmp记录.

范例:

id:3:initdefault:

系统引导完成后进入运行级3

si::sysinit:/etc/rc.d/rc.sysinit

系统引导时运行/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0

系统进入运行级0时执行/etc/rc.d/rc 0,这里 0 是参数

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

捕获到ctrl+alt+del时运行/sbin/shutdown -t3 -r now.如果想禁用ctrl+alt+del这个组合键,直接删除或注释掉这行

pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

电力中断时执行/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

1:2345:respawn:/sbin/mingetty tty1

进入运行级2,3,4或5时执行respawn:/sbin/mingetty tty1.注意指定的action是respawn,这也就是为什么我们在终端下logout后会立刻又出现一个login提示符

x:5:respawn:/etc/X11/prefdm -nodaemon

进入运行级5时执行/etc/X11/prefdm -nodaemon,指定的action是respawm

2.安全性

/etc/inittab的权限是644,所有者和所有组均为root

3.相关命令

init

telinit

更多内容请

man init

man inittab

/etc/termcap

一个数据库,包含所有可能的终端类型以及这些终端的性能。

 

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11109374.html