Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2236023
  • 博文数量: 292
  • 博客积分: 10016
  • 博客等级: 中将
  • 技术积分: 3381
  • 用 户 组: 普通用户
  • 注册时间: 2005-11-06 11:26
文章分类

全部博文(292)

文章存档

2011年(1)

2010年(4)

2009年(3)

2008年(6)

2007年(47)

2006年(63)

2005年(168)

分类: LINUX

2006-03-26 22:51:28

The Linux sysconfig directory

The /etc/sysconfig directory is where many of the files that control the system configuration are stored. This section lists these files and many of the optional values in the files used to make system changes. To get complete information on these files read the file /usr/doc/initscripts-4.48/sysconfig.txt.

  • /etc/sysconfig/clock

    Used to configure the system clock to Universal or local time and set some other clock parameters. An example file:
    UTC=false
    ARC=false
    
    Options:
    • UTC - true means the clock is set to UTC time otherwise it is at local time
    • ARC - Set true on alpha stations only. It indicates the ARC console's 42-year time offset is in effect. If not set to true, the normal Unix epoch is assumed.
    • ZONE="filename" - indicates the zonefile under the directory /usr/share/zoneinfo that the /etc/localtime file is a copy of. This may be set to:

      ZONE="US/Eastern"

  • /etc/sysconfig/init

    This file is used to set some terminal characteristics and environment variables. A sample listing:
    # color => new RH6.0 bootup
    # verbose => old-style bootup
    # anything else => new style bootup without ANSI colors or positioning
    BOOTUP=color
    # column to start "[  OK  ]" label in 
    RES_COL=60
    # terminal sequence to move to that column. You could change this
    # to something like "tput hpa ${RES_COL}" if your terminal supports it
    MOVE_TO_COL="echo -en \\033[${RES_COL}G"
    # terminal sequence to set color to a 'success' color (currently: green)
    SETCOLOR_SUCCESS="echo -en \\033[1;32m"
    # terminal sequence to set color to a 'failure' color (currently: red)
    SETCOLOR_FAILURE="echo -en \\033[1;31m"
    # terminal sequence to set color to a 'warning' color (currently: yellow)
    SETCOLOR_WARNING="echo -en \\033[1;33m"
    # terminal sequence to reset to the default color.
    SETCOLOR_NORMAL="echo -en \\033[0;39m"
    # default kernel loglevel on boot (syslog will reset this)
    LOGLEVEL=1
    # Set to something other than 'no' to turn on magic sysrq keys...
    MAGIC_SYSRQ=no
    # Set to anything other than 'no' to allow hotkey interactive startup...
    PROMPT=yes
    
    Options:
    • BOOTUP=bootupmode - Choices are color, or verbose. The choice color sets new boot display. The choice verbose sets old style display. Anything else sets a new display without ANSI formatting.
    • LOGLEVEL=number - Sets the initial console logging level for the kernel. The default is 7. The values are:
      1. emergency, panic - System is unusable
      2. alert - Action must be taken immediately
      3. crit - Critical conditions
      4. err, error (depreciated) - Error conditions
      5. warning, warn (depreciated) - Warning conditions
      6. notice - Normal but significant conditions
      7. info - Informational message
      8. debug - Debug level message
    • RES_COL=number - Screen column to start status labels at. The Default is 60.
    • MOVE_TO_COL=command - A command to move the cursor to $RES_COL.
    • SETCOLOR_SUCCESS=command - Set the color used to indicate success.
    • SETCOLOR_FAILURE=command - Set the color used to indicate failure.
    • SETCOLOR_WARNING=command - Set the color used to indicate warning.
    • SETCOLOR_NORMAL=command - Set the color used tor normal color
    • MAGIC_SYSRQ=yes|no - Set to 'no' to disable the magic sysrq key.
    • PROMPT=yes|no - Set to 'no' to disable the key check for interactive mode.

  • /etc/sysconfig/keyboard

    Used to configure the keyboard. Used by the startup script /etc/rc.d/rc.sysinit. An example file:
    KEYTABLE="us"
    
    Options:
    • KEYTABLE="keytable file" - The line [ KEYTABLE="/usr/lib/kbd/keytables/us.map" ] tells the system to use the file shown for keymapping.
    • KEYBOARDTYPE=sun|pc - The selection, "sun", indicates attached on /dev/kbd is a sun keyboard. The selection "pc" indicates a PS/2 keyboard is on the ps/2 port.

  • /etc/sysconfig/mouse

    This file is used to configure the mouse. An example file:
    FULLNAME="Generic - 2 Button Mouse (PS/2)"
    MOUSETYPE="ps/2"
    XEMU3="yes"
    XMOUSETYPE="PS/2"
    
    Options:
    • MOUSETYPE=type - Choices are microsoft, mouseman, mousesystems, ps/2, msbm, logibm, atibm, logitech, mmseries, or mmhittab.
    • XEMU3=yes|no - If yes, emulate three buttons, otherwise not.

  • /etc/sysconfig/network

    Used to configure networking options. All IPX options default to off. An example file:
    NETWORKING=yes
    FORWARD_IPV4="yes"
    HOSTNAME="mdct-dev3"
    GATEWAY="10.1.0.25"
    GATEWAYDEV="eth0"
    
    Options:
    • NETWORKING=yes|no - Sets network capabilities on or off.
    • HOSTNAME="hostname". To work with old software, the /etc/HOSTNAME file should contain the same hostname.
    • FORWARD_IPV4=yes|no - Turns the ability to perform IP forwarding on or off. Turn it on if you want to use the machine as a router. Turn it off to use it as a firewall or IP masquerading.
    • DEFRAG_IPV4=yes|no - Set this to automatically defragment IPv4 packets. This is good for masquerading, and a bad idea otherwise. It defaults to 'no'.
    • GATEWAY="gateway IP"
    • GATEWAYDEV="gateway device" Possible values include eth0, eth1, or ppp0.
    • NISDOMAIN="nis domain name"
    • IPX=yes|no - Turn IPX ability on or off.
    • IPXAUTOPRIMARY=on|off - Must not be yes or no.
    • IPXAUTOFRAME=on|off
    • IPXINTERNALNETNUM="netnum"
    • IPXINTERNALNODENUM="nodenum"

  • /etc/sysconfig/static-routes

    Configures static routes on a network. Used to set up static routing. An example file:
    eth1 net 192.168.199.0 netmask 255.255.255.0 gw 192.168.199.1
    eth0 net 10.1.0.0 netmask 255.255.0.0 gw 10.1.0.153
    eth1 net 255.255.255.255 netmask 255.255.255.255
    
    • The syntax is:

      device net network netmask netmask gw gateway

      The device may be a device name such as eth0 which is used to have the route brought up and down as the device is brought up or down. The value can also be "any" to let the system calculate the correct devices at run time.

  • /etc/sysconfig/routed

    Sets up dynamic routing policies. An example file:
    EXPORT_GATEWAY="no"
    SILENT="yes"
    
    Options:
    • SILENT=yes|no
    • EXPORT_GATEWAY=yes|no

  • /etc/sysconfig/pcmcia

    Used to configure pcmcia network cards. An example file:
    PCMCIA=no
    PCIC=
    PCIC_OPTS=
    CORE_OPTS=
    
    Options:
    • PCMCIA=yes|no
    • PCIC=i82365|tcic
    • PCIC_OPTS=socket driver (i82365 or tcic) timing parameters
    • CORE_OPTS=pcmcia_core options
    • CARDMGR_OPTS=cardmgr options

  • /etc/sysconfig/amd

    Used to configure the auto mount daemon. An example file:
    ADIR=/.automount
    MOUNTPTS='/net /etc/amd.conf'
    AMDOPTS=
    
    Options:
    • ADIR=/.automount (normally never changed)
    • MOUNTPTS='/net /etc/amd.conf' (standard automount stuff)
    • AMDOPTS= (extra options for AMD)

  • /etc/sysconfig/tape

    Used for backup tape device configuration. Options:
    • DEV=/dev/nst0 - The tape device. Use the non-rewinding tape for these scripts. For SCSI tapes the device is /dev/nst#, where # is the number of the tape drive you want to use. If you only have one then use nst0. For IDE tapes the device is /dev/ht#. For floppy tape drives the device is /dev/ftape.
    • ADMIN=root - The person to mail to if the backup fails for any reason
    • SLEEP=5 - The time to sleep between tape operations.
    • BLOCKSIZE=32768 - This worked fine for 8mm, then 4mm, and now DLT. An optimal setting is probably the amount of data your drive writes at one time.
    • SHORTDATE=$(date +%y:%m:%d:%H:%M) - A short date string, used in backup log filenames.
    • DAY=$(date +log-%y:%m:%d) - Used for the log file directory.
    • DATE=$(date) - Date string, used in log files.
    • LOGROOT=/var/log/backup - Root of the logging directory
    • LIST=$LOGROOT/incremental-list - This is the file name the incremental backup will use to store the incremental list. It will be $LIST-{some number}.
    • DOTCOUNT=$LOGROOT/.count - For counting as you go to know which incremental list to use.
    • COUNTER=$LOGROOT/counter-file - For rewinding when done...might not use.
    • BACKUPTAB=/etc/backuptab - The file in which we keep our list of backup(s) we want to make.

  • /etc/sysconfig/sendmail

    An example file:
    DAEMON=yes
    QUEUE=1h
    
    Options:
    • DAEMON=yes|no - yes implies -bd
    • QUEUE=1h - Given to sendmail as -q$QUEUE. The -q option is not given to sendmail if /etc/sysconfig/sendmail exists and QUEUE is empty or undefined.

  • /etc/sysconfig/i18n

    Controls the system font settings. The language variables are used in /etc/profile.d/lang.sh. An example i18n file:
    LANG="en_US"
    LC_ALL="en_US"
    LINGUAS="en_US"
    
    Options:
    • LANG= set locale for all categories, can be any two letter ISO language code.
    • LC_CTYPE= localedata configuration for classification and conversion of characters.
    • LC_COLLATE= localedata configuration for collation (sort order) of strings.
    • LC_MESSAGES= localedata configuration for translation of yes and no messages.
    • LC_NUMERIC= localedata configuration for non-monetary numeric data.
    • LC_MONETARY= localedata configuration for monetary data.
    • LC_TIME= localedata configuration for date and time.
    • LC_ALL= localedata configuration overriding all of the above.
    • LANGUAGE= can be a : separated list of ISO language codes.
    • LINGUAS= can be a ' ' separated list of ISO language codes.
    • SYSFONT= any font that is legal when used as /usr/bin/consolechars -f $SYSFONT ... (See console-tools package for consolechars command)
    • UNIMAP= any SFM (screen font map, formerly called Unicode mapping table - see consolechars(8))

      /usr/bin/consolechars -f $SYSFONT --sfm $UNIMAP

    • SYSFONTACM= any ACM (application charset map - see consolechars(8))

      /usr/bin/consolechars -f $SYSFONT --acm $SYSFONTACM

      The above is used by the /sbin/setsysfont command (which is run by rc.sysinit at boot time.)


  • /etc/sysconfig/network-scripts/ifup:
    /etc/sysconfig/network-scripts/ifdown:

    These are symbolic links to /sbin/ifup and /sbin/ifdown, respectively. These symlinks are here for legacy purposes only. They will probably be removed in future versions. These scripts take one argument normally: the name of the device (e.g. eth0). They are called with a second argument of "boot" during the boot sequence so that devices that are not meant to be brought up on boot (ONBOOT=no, see below) can be ignored at that time.

  • /etc/sysconfig/network-scripts/network-functions

    This is not really a public file. Contains functions which the scripts use for bringing interfaces up and down. In particular, it contains most of the code for handling alternative interface configurations and interface change notification through netreport.

  • /etc/sysconfig/network-scripts/ifcfg-interface
    /etc/sysconfig/network-scripts/ifcfg-interface-clone

    Defines an interface. An example file called ifcfg-eth0:
    DEVICE="eth0"
    IPADDR="10.1.0.153"
    NETMASK="255.255.0.0"
    ONBOOT="yes"
    BOOTPROTO="none"
    IPXNETNUM_802_2=""
    IPXPRIMARY_802_2="no"
    IPXACTIVE_802_2="no"
    IPXNETNUM_802_3=""
    IPXPRIMARY_802_3="no"
    IPXACTIVE_802_3="no"
    IPXNETNUM_ETHERII=""
    IPXPRIMARY_ETHERII="no"
    IPXACTIVE_ETHERII="no"
    IPXNETNUM_SNAP=""
    IPXPRIMARY_SNAP="no"
    IPXACTIVE_SNAP="no"
    

    The /etc/sysconfig/network-scripts/ifcfg-interface-clone file only contains the parts of the definition that are different in a "clone" (or alternative) interface. For example, the network numbers might be different, but everything else might be the same, so only the network numbers would be in the clone file, but all the device information would be in the base ifcfg file.

    Base items in the above two files:

    • NAME="friendly name for users to see" - Most important for PPP. Only used in front ends.
    • DEVICE="name of physical device"
    • IPADDR=
    • NETMASK=
    • GATEWAY=
    • ONBOOT=yes|no
    • USERCTL=yes|no
    • BOOTPROTO=none|bootp|dhcp - If BOOTPROTO is not "none", then the only other item that must be set is the DEVICE item; all the rest will be determined by the boot protocol. No "dummy" entries need to be created.
    Base items being deprecated:
    • NETWORK="will be calculated automatically with ifcalc"
    • BROADCAST="will be calculated automatically with ifcalc"
    Ethernet-only items:
    • {IPXNETNUM,IPXPRIMARY,IPXACTIVE}_{802_2,802_3,ETHERII,SNAP} configuration matrix for IPX. Only used if IPX is active. Managed from /etc/sysconfig/network-scripts/ifup-ipx
    PPP/SLIP items:
    • PERSIST=yes|no
    • MODEMPORT=device - An example device is /dev/modem.
    • LINESPEED=speed - An example speed is 115200.
    • DEFABORT=yes|no - Tells netcfg whether or not to put default abort strings in when creating/editing the chat script and/or dip script for this interface.
    PPP-specific items
    • WVDIALSECT="list of sections from wvdial.conf to use" - If this variable is set, then the chat script (if it exists) is ignored, and wvdial is used to open the PPP connection.
    • PEERDNS=yes|no - Modify /etc/resolv.conf if peer uses msdns extension.
    • DEFROUTE=yes|no - Set this interface as default route?
    • ESCAPECHARS=yes|no -Simplified interface here doesn't let people specify which characters to escape; almost everyone can use asyncmap 00000000 anyway, and they can set PPPOPTIONS to asyncmap foobar if they want to set options perfectly).
    • HARDFLOWCTL=yes|no - Yes implies "modem crtscts" options.
    • PPPOPTIONS="arbitrary option string" - It is placed last on the command line, so it can override other options like asyncmap that were specified differently.
    • PAPNAME="name $PAPNAME" - On pppd command line. Note that the "remotename" option is always specified as the logical ppp device name, like "ppp0" (which might perhaps be the physical device ppp1 if some other ppp device was brought up earlier...), which makes it easy to manage pap/chap files -- name/password pairs are associated with the logical ppp device name so that they can be managed together.
    • REMIP="remote ip address" - Normally unspecified.
    • MTU=
    • MRU=
    • DISCONNECTTIMEOUT="number of seconds" The current default is 5. This is the time to wait before re-establishing the connection after a successfully-connected session terminates before attempting to establish a new connection.
    • RETRYTIMEOUT="number of seconds" - The current default is 60. This is the time to wait before re-attempting to establish a connection after a previous attempt fails.
  • /etc/sysconfig/network-scripts/chat-interface - This is the chat script for PPP or SLIP connection intended to establish the connection. For SLIP devices, a DIP script is written from the chat script; for PPP devices, the chat script is used directly.

  • /etc/sysconfig/network-scripts/dip-interface

    A write-only script created from the chat script by netcfg. Do not modify this. In the future, this file may disappear by default and created on-the-fly from the chat script if it does not exist.

  • /etc/sysconfig/network-scripts/ifup-post

    Called when any network device EXCEPT a SLIP device comes up. Calls /etc/sysconfig/network-scripts/ifup-routes to bring up static routes that depend on that device. Calls /etc/sysconfig/network-scripts/ifup-aliases to bring up aliases for that device. Sets the hostname if it is not already set and a hostname can be found for the IP for that device. Sends SIGIO to any programs that have requested notification of network events. It could be extended to fix up nameservice configuration, call arbitrary scripts, etc, as needed.

  • /etc/sysconfig/network-scripts/ifup-routes

    Set up static routes for a device. An example file:
    #!/bin/sh
    
    # adds static routes which go through device $1
    
    if [ "$1" = "" ]; then
    	echo "usage: $0 "
    	exit 1
    fi
    
    if [ ! -f /etc/sysconfig/static-routes ]; then
    	exit 0
    fi
    
    #note the trailing space in the grep gets rid of aliases
    grep "^$1 " /etc/sysconfig/static-routes | while read device args; do
    	/sbin/route add -$args $device
    done
    
    
  • /etc/sysconfig/network-scripts/ifup-aliases

    Bring up aliases for a device.

  • /etc/sysconfig/network-scripts/ifdhcpc-done

    Called by dhcpcd once dhcp configuration is complete; sets up /etc/resolv.conf from the version dhcpcd dropped in /etc/dhcpc/resolv.conf
阅读(2533) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~