安装 Oracle® Solaris 11.2 系统

退出打印视图

更新时间: 2014 年 7 月
 
 

指定系统配置文件中的配置

可以使用 SMF 属性指定任何可配置的系统特征的配置。例如,系统配置文件可以配置 root 帐户、初始用户、键盘布局、终端类型、IPv4 网络接口(静态或 DHCP)和缺省路由、IPv6 网络接口(静态或 addrconf)和缺省路由,以及名称服务(名称服务器列表、搜索列表、域)。如果指定一个未应用的服务或属性,则忽略该说明。不要多次指定任何特定属性。

如果不确定需要指定哪些 SMF 属性,您可以使用 svccfg 命令的 describe 子命令来显示某个服务的属性组和属性的说明,包括可能的设置。请参见 svccfg(1M) 手册页中的 "Property Inspection and Modification Subcommands"(属性检查和修改子命令)。

svccfg -s FMRI describe [-v] [-t] [propertygroup/property]

通过指定属性组名称或者属性组名称和属性名称(用斜杠 (/) 隔开),可以将属性组或具体属性作为参数查询。

–v 选项提供所有的可用信息,包括当前设置、约束及其他可能的设置选择的说明。

–t 选项仅显示选择的模板数据(请参见 smf_template (5) 手册页),不显示属性组和属性的当前设置。

$ svccfg -s name-service/switch describe config
config                      application
    Name service switch configuration data as described in nsswitch.conf(4).
config/value_authorization  astring             solaris.smf.value.name-service.switch
config/default              astring             files
    Default configuration database entry.
config/host                 astring             "files dns mdns"
    Override configuration for host database lookups. (both IPv4 and IPv6 hosts)
config/printer              astring             "user files"
    Override configuration for printer database lookups.
$ svccfg -s name-service/switch describe -v config
config                      application
    name: config
    type: application
    required: true
    target: this
    description: Name service switch configuration data as described in nsswitch.conf(4).
config/value_authorization  astring             solaris.smf.value.name-service.switch
config/default              astring             files
    type: astring
    required: true
    Default configuration database entry.
    visibility: readwrite
    minimum number of values: 1
    maximum number of values: 1
  value: files
...
$ svccfg -s name-service/switch describe -t config
name: config
type: application
    Name service switch configuration data as described in nsswitch.conf(4).
  name: default
  type: astring
    Default configuration database entry.
  name: host
  type: astring
    Override configuration for host database lookups. (both IPv4 and IPv6 hosts)
  name: password
  type: astring
    Override configuration for passwd database lookups. Also used with the shadow and user_attr databases.
  name: group
  type: astring
    Override configuration for group database lookups.
  name: network
  type: astring
    Override configuration for network database lookups.
...
$ svccfg -s system/config-user describe root_account
root_account                     application
root_account/expire              astring
root_account/password            astring
root_account/read_authorization  astring            solaris.smf.read.system-config
root_account/stability           astring            Evolving
root_account/type                astring