[未完]linux配置文件整理

Linux 常用配置文件


大纲如下:

介绍 路径
grup配置文件 /boot/grub/grub.conf
系统运行级别配置文件 /etc/inittab
网络配置文件 /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network /etc/rc.d/init.d/network /etc/hosts /etc/services /etc/resolv.conf
文件系统管理 /etc/fstab
用户及用户组配置文件 /etc/passwd /etc/shadow /etc/group /etc/gshadow
系统终端登录信息 /etc/issue
用户登录成功提示信息 /etc/motd

暂时先这些后续补全


/boot/grub/grub.conf 为grub自身的菜单选项,以及启动内核时向内核传递的参数.
注:/etc/grub.conf文件为此文件的软链接

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda2
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS 6 (2.6.32-696.el6.x86_64)
    root (hd0,0)
    kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=UUID=ca9400eb-b947-4a5f-a358-ffe4f64a7389 nomodeset rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_LVM rd_NO_DM rhgb quiet
    initrd /initramfs-2.6.32-696.el6.x86_64.img

default 默认启动的系统,以title为序号从0开始计数
timeout grub启动菜单默认等待的时间
splashimage 指定grub引导选项的背景图片
hiddenmenu 隐藏菜单
title 定义菜单项名称,并分割每个启动选项
root 定义系统内核所在的分区,以grub读取的分区为标准,表示方法与Linux系统的表示方法有差异
kernel 指定内核所在位置,及加载内核时向内核中传递的启动参数
initrd 指定镜像文件所在位置


/etc/inittab为启动时定义系统启动运行级别的文件.

# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
# 
id:5:initdefault:

此文件有效的配置只有一行,其余带有井号的都为注释文件.
格式为:label:runlevel:action:process
==lable 标识符==,一般为两位字母或数字,可以随意指定
==run-levels 运行级别==,可以指定多个
==action是描述其后的process的运行方式的==。

选项 功能
initdefault 该选项声明不运行后面的process,结果是以默认的运行级别运行
sysinit 系统启动任何运行级别都执行 process
wait 执行 process 中的指定命令并等其结再执行其他命令
crtlaltdel 按下 crtl+alt+del 时执行 process 指定的命令

==process 运行脚本的命令==

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章