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 運行腳本的命令==